I'm getting the following error during nest build script:
Error Debug Failure. False expression: import= for internal module references should be handled in an earlier transformer.
I am not able to understand what it indicate. Want succesfull nest build phase
I'm getting the following error during nest build script:
Error Debug Failure. False expression: import= for internal module references should be handled in an earlier transformer.
I am not able to understand what it indicate. Want succesfull nest build phase
- 1 Can you provide code/ additional output? – Vincent Menzel Commented Aug 28, 2023 at 8:44
- @VincentMenzel this is the only error I'm getting. > nest build Error Debug Failure. False expression: import= for internal module references should be handled in an earlier transformer. – Ashish Kumar Commented Aug 28, 2023 at 9:13
- I am facing the same issue, wondering if it has something to do with nest dependency – Haruna Akhmad Commented Aug 28, 2023 at 12:32
- Please provide enough code so others can better understand or reproduce the problem. – Community Bot Commented Aug 28, 2023 at 13:07
- @VincentMenzel I fixed the issue by changing my typescript version, mine was "typescript": "^5.0.2", i changed to "typescript": "^4.3.5" – Haruna Akhmad Commented Aug 28, 2023 at 13:15
1 Answer
Reset to default 8Typescript
v5.2 contains a "small" breaking change (see https://devblogs.microsoft./typescript/announcing-typescript-5-2/#modules-always-emits-as-namespace) which I suspect triggers the problem in webpack
.
TypeScript 5.2 will always emit the namespace keyword when generating declaration files. So code like the following:
module foo { export function f() {} }
will result in the following declaration file:
declare namespace foo { function f(): void; }
While this may be inpatible with much much older versions of TypeScript, we believe the impact should be limited.
Of course, this should have meant that 5.2
was actually 6.0
if they were truly being semver
pliant.
I have temporarily pinned my typescript
at v5.1.6
and all seems well with webpack 5.88.2
(which is a dependency of my current version of nestjs