"Debug Failure. False expression." after each change with ts-loader and webpack-dev-server
See original GitHub issueplease see https://github.com/microsoft/TypeScript/issues/46555
I have a setup with webpack, ts-loader and typescript where after a single change typescript errors out and I have to restart WDS.
Reproduction
cd apps\app1\app
yarn
yarn start
meanwhile, open file apps\app1\client-components\src\lib.ts
and change the returned number
Location of a Minimal Repository that Demonstrates the Issue.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:5 (2 by maintainers)
Top Results From Across the Web
"Debug Failure. False expression." after each change with ts ...
Bug Report. I have a setup with webpack, ts-loader and typescript where after a single change typescript errors out and I have to...
Read more >node.js - Webpack: Error: Debug Failure. False expression
I have already tried npm i typescript but keep getting the same error. package.json { "name": "webpack-demo", "version": "1.0 ...
Read more >angular/angular-cli - Gitter
ERROR in ./src/app/app.module.ts Module build failed: Error: Debug Failure. False expression: Declaration file is not present only for javascript files at ...
Read more >TypeScript - webpack
In this guide we will learn how to integrate TypeScript with webpack. Basic Setup. First install the TypeScript compiler and loader by running:...
Read more >How I solved and debugged my Webpack issue through trial ...
I replaced webpack-dev-server with webpack serve in my package.json. But trying webpack-serve didn't solve it either. So at this point I felt ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@0x53A,
I have not investigated your code fully but I think you are trying to use TypeScript project references. When you are using project references TypeScript will pre-transpile your references and you should be including the transpiled code in your main app. So in App.tsx where you have:
You should be importing from the transpiled JavaScript, not the source TypeScript.
I wrote a couple of Medium articles on ts-loader and project references that you might find helpful:
https://medium.com/@nickexcell/using-typescript-project-references-with-ts-loader-and-webpack-part-1-5d0c3cd7c603
I am still having this issue, I think we should reopen.edit: I’ve managed to workaround this using
"exclude"
into the root ts-config file to exclude the reference. It looks like ts-loader was somehow processing it twice when in watch mode. edit2: Nevermind, looks like this is an issue with nesting ts references into the same folder, separating each reference into it’s own folder fully resolved this.