#1717·bluebird

Error using bluebird with --frozen-intrinsics

Author: kevinoidCreated Nov 6, 2024Updated Nov 6, 2024
  1. What version of bluebird is the issue happening on? 3.7.2

  2. What platform and version? (For example Node.js 0.12 or Google Chrome 32) Node.js v11.12 and later

  3. Did this issue happen with earlier version of bluebird? The issue is present in bluebird 2.x and 3.x, but not 1.x.

When node is invoked with the experimental --frozen-intrinsics flag (added in Node.js 11.12 by nodejs/node#25685) it causes bluebird to throw TypeError: Cannot define property __BluebirdErrorTypes__, object is not extensible:

$ node --frozen-intrinsics -e "require('bluebird')"
/path/to/node_modules/bluebird/js/release/errors.js:99
    es5.defineProperty(Error, "__BluebirdErrorTypes__", {
        ^

TypeError: Cannot define property __BluebirdErrorTypes__, object is not extensible
    at Object.defineProperty (<anonymous>)
    at Object.<anonymous> (/path/to/node_modules/bluebird/js/release/errors.js:99:9)
    at Module._compile (node:internal/modules/cjs/loader:1572:14)
    at Object..js (node:internal/modules/cjs/loader:1709:10)
    at Module.load (node:internal/modules/cjs/loader:1315:32)
    at Function._load (node:internal/modules/cjs/loader:1125:12)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:216:24)
    at Module.require (node:internal/modules/cjs/loader:1337:12)
    at require (node:internal/modules/helpers:139:16)

Node.js v23.1.0

Is there any chance bluebird might consider supporting --frozen-intrinsics?