最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Error Debug Failure. False expression: import= for internal module references should be handled in an earlier trans

programmeradmin5浏览0评论

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

Share Improve this question asked Aug 28, 2023 at 8:35 Ashish KumarAshish Kumar 911 silver badge2 bronze badges 5
  • 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
Add a ment  | 

1 Answer 1

Reset to default 8

Typescript 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

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论