You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Accessing non-existent property 'getOptionValue' of module exports inside circular dependency
This happens when using allowJs. We have some code running inside our require.extensions['.js'] compile hook that is trying to require() an internal helper file, dist-raw/node-options. This file is '.js', so it triggers the same require hook with allowJs, which causes a circular dependency. The fix is to eagerly require this stuff so we're not require()ing dynamically within our CJS hooks.
Appears assertScriptCanLoadAsCJSImpl needs to check package.jsontype field, which triggers the circular dependency.
(node:3327) Warning: Accessing non-existent property 'getOptionValue' of module exports inside circular dependency
at emitCircularRequireWarning (node:internal/modules/cjs/loader:707:11)
at Object.get (node:internal/modules/cjs/loader:721:5)
at Object.read (/d/Personal-dev/@TypeStrong/ts-node/repro-1477/dist-raw/node-package-json-reader.js:29:11)
at readPackage (/d/Personal-dev/@TypeStrong/ts-node/repro-1477/dist-raw/node-cjs-loader-utils.js:63:36)
at readPackageScope (/d/Personal-dev/@TypeStrong/ts-node/repro-1477/dist-raw/node-cjs-loader-utils.js:44:19)
at assertScriptCanLoadAsCJSImpl (/d/Personal-dev/@TypeStrong/ts-node/repro-1477/dist-raw/node-cjs-loader-utils.js:20:15)
at Object.require.extensions.<computed> [as .js] (/d/Personal-dev/@TypeStrong/ts-node/repro-1477/src/index.ts:1302:5)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
The text was updated successfully, but these errors were encountered:
Accessing non-existent property 'getOptionValue' of module exports inside circular dependency
This happens when using
allowJs
. We have some code running inside ourrequire.extensions['.js']
compile hook that is trying torequire()
an internal helper file,dist-raw/node-options
. This file is '.js', so it triggers the same require hook withallowJs
, which causes a circular dependency. The fix is to eagerly require this stuff so we're notrequire()
ing dynamically within our CJS hooks.ts-node/dist-raw/node-package-json-reader.js
Line 26 in 8a9ae84
Appears
assertScriptCanLoadAsCJSImpl
needs to checkpackage.json
type
field, which triggers the circular dependency.The text was updated successfully, but these errors were encountered: