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
{{ message }}
Repository navigation
error TS7022: '__importDefault' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. #883
I receive this error only while running ts-node as the loader, but not while compiling with typescript directly. I've attached the contents of my project's root\api dir, C:\www\node-framework\api for inspection. The only two files currently being touched by typescript should be C:\www\node-framework\api\src\framework.ts and C:\www\node-framework\api\src\app.ts
It looks like you've registered ts-node twice, so it's compiling your TypeScript then again with the output from TypeScript.
Reacted by Eduardo Daniel Cuomo, Ishmael Kargbo, Matheus Noronha, Ivan Yarych, Washington Soares, Chris Short, Yohann, Mustafa Ekrem KENTER, RNm-dove, vlad-ostrovski and 2 more
Activity
blakeembrey commentedon Sep 10, 2019
It looks like you've registered
ts-nodetwice, so it's compiling your TypeScript then again with the output from TypeScript.blakeembrey commentedon Sep 10, 2019
It actually says so in your CLI:
ts-node --require ts-node/register- use one or the other, not both at the same time.reduardo7 commentedon Jan 14, 2020
Like @blakeembrey said, you should use
node_modules/.bin/ts-node ./src/framework.tsornode --require ts-node/register ./src/framework.tsdev-isho commentedon Feb 24, 2020
Woo Thanks it works
rxliuli commentedon Jun 6, 2021
Is there a way to check whether ts-node is used to run the code in the code? such as environment variables