-
Notifications
You must be signed in to change notification settings - Fork 8
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
An import path cannot end with a '.ts' extension. #21
Comments
You need to set moduleResolution to node in {
"compilerOptions": {
"moduleResolution": "node"
}
} |
I already had module resolution to node. This is my exact tsconfig.
|
Then the error is being generated by your linter, not the typescript compiler. You need to find any rules that say "no import with .ts extension" in your linter config and disable it. |
It seem like it is not a linting issue. I've tried ignoring the line and disabling my whole linter but it is still erroring. The only way to get it to not error is to use @ts-ignore but that makes the library lose all of its typings. Update: I'm able to use Moq.ts perfectly fine, but not this library. |
Using @ts-ignore should not make it lose all of its typings. At least, this is not what should happen in Visual Studio Code. It might be different in other IDE's because displaying the typings is an IDE feature. I suspect that the error you're having is also an IDE error if it is not the ts compiler or linter. I would try switching over to VS Code. |
I hate stating the obvious, but you need to reinstall because all your issues sound like you don't have it installed.
Also, does this issue occur on a vanilla typescript project (no frameworks like Remix). If it doesn't, you know that it's because of some compiler/linter config set by Remix that you have to change. |
I'm running into the same issue with a fairly vanilla Typescript config: {
"compilerOptions": {
"lib": ["ES2019", "DOM"],
"target": "es2018",
"module": "ES2020",
"moduleResolution": "node",
"declaration": true,
"strict": true,
"experimentalDecorators": true,
"esModuleInterop": true,
"sourceMap": true,
"resolveJsonModule": true,
"noEmit": true
},
"include": ["src"],
"exclude": ["node_modules"]
}
|
Okay, I renamed the file |
Thanks! |
Getting this error in my build when trying out the library. Probably due to the .ts ending in the name of the library.
Currently using the default Typescript environment setup w/ Remix.
The text was updated successfully, but these errors were encountered: