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
I'm trying to use turkey-neighbourhoods@v3 in a nx monorepo with the default tsconfig
> nx run my-app-name:serve:development
node:internal/errors:490
ErrorCaptureStackTrace(err);
^
Error [ERR_REQUIRE_ESM]: require() of ES Module /path-to-repo/node_modules/.pnpm/[email protected]/node_modules/turkey-neighbourhoods/dist/turkey-neighbourhoods.cjs.js not supported.
turkey-neighbourhoods.cjs.js is treated as an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which declares all .js files in that package scope as ES modules.
Instead rename turkey-neighbourhoods.cjs.js to end in .cjs, change the requiring code to use dynamic import() which is available in all CommonJS modules, or change "type": "module" to "type": "commonjs" in /path-to-repo/node_modules/.pnpm/[email protected]/node_modules/turkey-neighbourhoods/package.json to treat all .js files as CommonJS (using .mjs for all ES modules instead).
at Module._load (/path-to-repo/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]/node_modules/@nx/js/src/executors/node/node-with-require-overrides.js:18:31)
at Object.defineProperty.value (/path-to-repo/dist/apps/my-app-name/main.js:6252:18)
at __webpack_require__ (/path-to-repo/dist/apps/my-app-name/main.js:6448:41)
at Array.<anonymous> (/path-to-repo/dist/apps/my-app-name/main.js:6211:33)
at __webpack_require__ (/path-to-repo/dist/apps/my-app-name/main.js:6448:41)
at Object.defineProperty.value (/path-to-repo/dist/apps/my-app-name/main.js:5734:28)
at __webpack_require__ (/path-to-repo/dist/apps/my-app-name/main.js:6448:41)
at Object.defineProperty.value (/path-to-repo/dist/apps/my-app-name/main.js:5408:48)
at __webpack_require__ (/path-to-repo/dist/apps/my-app-name/main.js:6448:41)
at Object.defineProperty.value (/path-to-repo/dist/apps/my-app-name/main.js:5390:22)
at __webpack_require__ (/path-to-repo/dist/apps/my-app-name/main.js:6448:41)
at Object.defineProperty.value (/path-to-repo/dist/apps/my-app-name/main.js:3796:30)
at __webpack_require__ (/path-to-repo/dist/apps/my-app-name/main.js:6448:41)
at Object.defineProperty.value (/path-to-repo/dist/apps/my-app-name/main.js:3719:28)
at __webpack_require__ (/path-to-repo/dist/apps/my-app-name/main.js:6448:41)
at Object.defineProperty.value (/path-to-repo/dist/apps/my-app-name/main.js:1530:31)
at __webpack_require__ (/path-to-repo/dist/apps/my-app-name/main.js:6448:41)
at Object.defineProperty.value (/path-to-repo/dist/apps/my-app-name/main.js:1513:22)
at __webpack_require__ (/path-to-repo/dist/apps/my-app-name/main.js:6448:41)
at Object.defineProperty.value (/path-to-repo/dist/apps/my-app-name/main.js:412:20)
at __webpack_require__ (/path-to-repo/dist/apps/my-app-name/main.js:6448:41)
at Array.<anonymous> (/path-to-repo/dist/apps/my-app-name/main.js:14:22)
at __webpack_require__ (/path-to-repo/dist/apps/my-app-name/main.js:6448:41)
at /path-to-repo/dist/apps/my-app-name/main.js:6475:37
at Object.<anonymous> (/path-to-repo/dist/apps/my-app-name/main.js:6480:12)
at Module._load (/path-to-repo/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]/node_modules/@nx/js/src/executors/node/node-with-require-overrides.js:10:31) {
code: 'ERR_REQUIRE_ESM'
}
Node.js v18.15.0
The text was updated successfully, but these errors were encountered:
I'm trying to use turkey-neighbourhoods@v3 in a nx monorepo with the default tsconfig
The text was updated successfully, but these errors were encountered: