question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Debug Failure. False expression." after each change with ts-loader and webpack-dev-server

See original GitHub issue

please 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.

https://github.com/0x53A/typescript-46555

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
appzukacommented, Nov 6, 2021

@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:

import {f} from 'client-components/src/lib';

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

0reactions
adipascucommented, Dec 23, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found