Cannot run with node once compiled
See original GitHub issuenode version: v12.13.1 os: MacOS typescript: 3.9.6 tslog: 2.6.1
I have no issue running this with ts-node
, but when I actually run the tsc on my project and do a node ./dist/index.js
I get the following error. I have tried removing it and everything works as expected, but as soon as I even just instantiate the new Logger()
I get the error below.
/Users/****/source/*****/node_modules/@babel/template/lib/builder.js:71
rootStack = error.stack.split("\n").slice(3).join("\n");
tsconfig.json
"compilerOptions": {
"target": "es5",
"lib": ["esnext"],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"module": "commonjs",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": false,
"strict": true,
"noErrorTruncation": true,
"rootDir": "src",
"outDir": "dist",
"sourceMap": true
},
"include": ["./src/**/*"],
"exclude": [
"node_modules"
]
}```
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
node.js - Cannot overwrite model once compiled Mongoose
The first time you call the model creation function, mongoose stores the model under the key you provide (e.g. 'users'). If you call...
Read more >How to Fix Mongoose Cannot Overwrite Model Once ...
Cannot overwrite YOUR_MODEL_NAME model once compiled. As the error suggest this error occurs as a result of trying to override the same model...
Read more >OverwriteModelError: Cannot overwrite `User` model once ...
On Windows, if we try to open a User.js or user.js file, both will point to the same location (which is what happened...
Read more >ts-node - npm
This error is thrown by node when a module is require() d, but node believes it should execute as native ESM. This can...
Read more >Node.js – Cannot overwrite model once compiled Mongoose
Cannot overwrite 'users' model once compiled. I understand that this error comes due to mismatching of Schema, but I cannot see where this...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@terehov v2.6.3 fixed it thanks 😃
Thanks for reporting. Should be fixed in
2.6.2
.