-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: require() of ES Module node_modules\rsdi\dist\index.js #5
Comments
@pedro-lima-reis what version of node do you use and can you share your package.json file please |
@radzserg i have the same problem nodejs v20.4.0
|
v18.17.1 |
@pedro-lima-reis did you try to bundle your application to A time ago i faced this same kinda of problem, and i solve changing the way my application was built. just to exemplify, I use these configs: // tsup.config.ts
import { defineConfig } from 'tsup';
export default defineConfig({
tsconfig: './tsconfig.json',
entry: ['./src/**/*.ts'],
splitting: true,
sourcemap: true,
clean: true,
platform: 'node',
esbuildOptions(options, _context) {
// the directory structure will be the same as the source
options.outbase = './src';
},
target: 'node20',
format: 'esm',
treeshake: true,
outDir: 'build',
}); // tsconfig.json
{
"compilerOptions": {
"types": ["node"],
"module": "ESNext",
"moduleResolution": "Node",
"target": "ES2020",
"baseUrl": ".",
"outDir": "build",
"esModuleInterop": true,
"strict": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": true,
"forceConsistentCasingInFileNames": true,
"allowJs": true,
"rootDirs": ["src"],
"lib": ["DOM", "ESNext"],
"removeComments": true,
"paths": {
"@tests/*": ["./tests/*"],
"@/*": ["./src/*"]
},
"typeRoots": ["./types"],
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"strictPropertyInitialization": false
},
"include": ["src", "tests"],
"exclude": ["node_modules"]
} and in package.json I set Hope it helps. |
|
I'm closing this issue for now, since we don't have much feedback. |
I need some help with this:
I updated the version and make all adjustments needed
The text was updated successfully, but these errors were encountered: