-
-
Notifications
You must be signed in to change notification settings - Fork 534
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
8.0.3 breaks project with: Unable to require .d.ts
file
#797
Comments
I spent some time after upgrade dependencies to find out who broke my project. I installed previous version of the package and it solved issue. |
It seems that this commit broke my project. |
The same problem here. |
same here |
@blakeembrey any progress for this ? |
Does anyone want to provide a reproduction or test case? |
I am running into this issue with ts-node 8.0.3, yarn workspaces and TypeScript project references. I was able to reproduce the issue in this minimal example: https://github.com/mfellner/ts-node-issue-797 8.0.2 does not exhibit the problem. Hope that helps! |
I can confirm that this happens to me with yarn workspaces, too. But not every import from another workspace package fails. For example I've got a package with only type declarations and an import of those does not crash. |
yup, same problem.
to the so ts-node-dev for instance use the right version (and not the latest broken 8.0.3) |
I think it may be related to using |
Still an issue in 8.1.0. |
|
I solved by adding |
@gianmarcotoso Thank you for your suggestion, this helped me to resolve the issue in a similar setup. Furthermore enabling |
@gianmarcotoso Minor update: Currently I am experimenting with only creating a typings file or reverting to |
I am able to reproduce this issue reliably, and Given these files:
One can reliably get this error:
By (only) adding this file:
|
I can confirm that adding So moving from version |
Running into this as well. preserveSymlinks seems to fix it, but I don't understand why. This error message is not very helpful at finding the issue |
It looks like the issue was introduced when trying to better conform to the TypeScript compiler API by adding I'll also look into improving this error when I can, it hadn't come up in the past that the TypeScript compiler would give empty files back except when compiling |
Yes, removing the |
I've also just run into this in a totally separate scenario: I had mocha set to Definitely an edge case but maybe ts-node should emit a warning or error if it's registered twice. (I think a no-op would be less desirable, since someone might be trying to register it with different options and wondering why none of the options are having any effect.) |
Turns out that this actually is a breaking change that causes problems when using pnpm – see #876. |
This error is shown if I put my files inside src folder but not if I put them outside src. Does anyone know how to deal with it? I have tried preserveSymlinks but no luck. |
This is still an issue as of 8.4.1, and the |
@matthew-dean Can you create a reproduction? |
@blakeembrey In my case, I think it was actually because my mocha test path was set to |
@blakeembrey So maybe in my case, the error was legitimate because some node module had a test |
Another edge case for people who get here via 'cannot require I had a folder in my |
For anybody else who finds this from googling, my (probably very narrow) edge case:
my solution was to add |
@bvalosek In my case, it didn't solve the error. (I am not using lerna) 😥 This is still an issue on |
I think this is related to I have a project with TS and Babel and I added I'm just trying to find out how to connect |
As @IonelLupu said this is still an issue, even with |
I am also facing the same issue with |
I have resolved this issue by mentioning the file path in root of tsconfig.ts file
|
I'm seeing this bug with a very basic script: just |
Hey, today I upgraded the ts-node package to the newest version 8.0.3 and it now throws an exception:
The version 8.0.2 works. I had no time to find the exact cause.
The text was updated successfully, but these errors were encountered: