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
module.exports = require("pdf-merger-js");
^
Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/gim-uigyo/Documents/WORK/pdf/node_modules/pdf-merger-js/index.js from /Users/gim-uigyo/Documents/WORK/pdf/dist/main.js not supported.
Instead change the require of index.js in /Users/gim-uigyo/Documents/WORK/pdf/dist/main.js to a dynamic import() which is available in all CommonJS modules.
at pdf-merger-js (/Users/gim-uigyo/Documents/WORK/pdf/dist/main.js:1962:18)
at webpack_require (/Users/gim-uigyo/Documents/WORK/pdf/dist/main.js:2036:42)
at ./src/resources/pdf/services/pdf.service.ts (/Users/gim-uigyo/Documents/WORK/pdf/dist/main.js:1520:25)
at webpack_require (/Users/gim-uigyo/Documents/WORK/pdf/dist/main.js:2036:42)
at ./src/resources/pdf/pdf.controller.ts (/Users/gim-uigyo/Documents/WORK/pdf/dist/main.js:1051:23)
The text was updated successfully, but these errors were encountered:
Also facing this issue. Changing the compiler from commonjs to ESNext(or any ES Modules compilers) seems to fix the issue, but now ran into another error
Error: Cannot find module '.../dist/app.module' imported from .../dist/main.js
For now, i also downgraded to 4.3.1, but i'd like to change my compiler settings, to import the dependencies as modules in the dist files ?
Anyone had a chance to play with the ts-config settings, in a nest.js app ?
I deleted the library and when I reinstalled it, suddenly strange errors occurred.
I use nestjs. Please help me
"pdf-merger-js": "^5.1.1",
"node": "20.11.1",
yarn: 3.6.1,
"@nestjs/core": "^9.0.0",
tsconfig.json
{
"compilerOptions": {
"module": "commonjs",
"declaration": true,
"removeComments": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"allowJs": true,
"allowSyntheticDefaultImports": true,
"target": "es2017",
"sourceMap": true,
"outDir": "./dist",
"baseUrl": "./",
"incremental": true,
"skipLibCheck": true,
"strictNullChecks": false,
"noImplicitAny": false,
"strictBindCallApply": false,
"forceConsistentCasingInFileNames": false,
"noFallthroughCasesInSwitch": false
}
}
module.exports = require("pdf-merger-js");
^
Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/gim-uigyo/Documents/WORK/pdf/node_modules/pdf-merger-js/index.js from /Users/gim-uigyo/Documents/WORK/pdf/dist/main.js not supported.
Instead change the require of index.js in /Users/gim-uigyo/Documents/WORK/pdf/dist/main.js to a dynamic import() which is available in all CommonJS modules.
at pdf-merger-js (/Users/gim-uigyo/Documents/WORK/pdf/dist/main.js:1962:18)
at webpack_require (/Users/gim-uigyo/Documents/WORK/pdf/dist/main.js:2036:42)
at ./src/resources/pdf/services/pdf.service.ts (/Users/gim-uigyo/Documents/WORK/pdf/dist/main.js:1520:25)
at webpack_require (/Users/gim-uigyo/Documents/WORK/pdf/dist/main.js:2036:42)
at ./src/resources/pdf/pdf.controller.ts (/Users/gim-uigyo/Documents/WORK/pdf/dist/main.js:1051:23)
The text was updated successfully, but these errors were encountered: