-
-
Notifications
You must be signed in to change notification settings - Fork 431
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
2.2.1 = npm error "Could not find file:" ... #568
Comments
That's strange... Our builds are passing. Do you have any more details? |
Would you be able to test the build I created here?: https://github.com/johnnyreilly/ts-loader It contains a speculative fix for your issue... |
Hey John, sorry no go on that one. Just compiled it, dropped it in and am getting this:
The only thing that pops out is Tapable.js, which I'm assuming is installed via another package, as I don't explicitly have it in my package.json The npm log file has even less info than that. |
Thanks for testing. I'll probably merge that anyway as it uses the compiler methods for file resolution rather than ts-loader's and so it gets us closer to like-like behaviour between tsc and ts-loader. (Always a goal.) I'm drawing a bit of a blank on what might be causing this. Ts-loader doesn't directly depend on tapable. Kind of surprised ts-loader 2.2.0 is working with ts 2.4.1 anyway. ts-loader 2.2.1 was released to address a change that broke ts-loader that landed in TypeScript with 2.4.1... See #565 |
* Speculative fix for #568 * Remove default of setting isolatedModules to true when in transpileOnly mode Not useful for when using ts-loader with fork-ts-checker-webpack-plugin. Can still be set manually with tsconfig.json if desired and so arguably not a breaking change
with 2.2.2 my project now compiles fine with TS 2.4.1 👍 Edit: Disregard, I had locked in my package.json at 2.2.0 and assumed |
Been there, done that! I wonder what the issue can be... Can you share a repo that demo's the issue? |
I encountered the same problem as @timothyallan. I'm on |
Sure - we're unable to reproduce the issue though |
I encountered this error with a single index.js file and the configuration below. Renaming the file to be index.ts did resolve the issue. tsconfig:
webpack.config.js
error:
|
Nice find @frankwallis . The loader now passes my first app.js file when I rename it to app.ts. However, I'm using a very mixed .js/.jsx project, so there's a few .js files that I can't change to .ts i.e. |
Is this related to #586 by any chance? |
ok after reading through #586 I managed to resolve it by adding the
It seems to me that specifying The issue now is that it is type-checking js files in node_modules, which is the same issue as #577. |
Something worth considering. I mean to take another look at
There was a potential solution to #577 - I was hoping for a PR on that. If you'd like to have a go you're most welcome! |
See #586 for details of progress on this. |
I believe this is now resolved by #590 |
Negatory :(
Rolling back to 2.2.0 still works great. |
Could you provide a minimal repro please? I've got nothing to work with at present... |
FWIW I'm pretty sure the @schmuli change is the cause: https://github.com/TypeStrong/ts-loader/pull/564/files However without understanding what your use case is it's hard to know how to handle this correctly. |
btw I'm kind of assuming you're using |
Totally understand on the min repro. This is a beast of a production project with a ton of linked stuff though. I'll see what I can do.
|
Thanks @timothyallan 👍 |
@johnnyreilly I was also running into this error, and I fixed it by making sure that all expected files were included via the TSConfig file. This usually means having a For example, in my situation I was trying to compile tests, using an entry file with a {
"compilerOptions": { ... },
"files": [ "main.spec.ts" ],
"includes": [
"./src/app/**/*.spec.ts",
"./src/app/**/*.spec.js"
]
} |
Thanks @schmuli - hopefully with a minimal repro we can deal with this once and for all! |
Sorry gents, calling this one a day. Amount of time spent debugging > amount of hassle switching to awesome-typescript-loader, which is working fine. |
Just started getting this npm build error with 2.2.1, not a ton of other details I can find yet.
using it like this
If I revert to 2.2.0, everything works fine.
Using Typescript 2.4.1, NPM 5.0.3 on macOs
The text was updated successfully, but these errors were encountered: