question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot run with node once compiled

See original GitHub issue

node 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:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
DevFlexcommented, Jul 17, 2020

@terehov v2.6.3 fixed it thanks 😃

1reaction
terehovcommented, Jul 16, 2020

Thanks for reporting. Should be fixed in 2.6.2.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found