Skip to content

fix: TS5011 errors with TypeScript 6.0: transpileModule called with rootDir: undefined#1695

Open
tweet wants to merge 2 commits into
TypeStrong:webpack-4from
tweet:fix-webpack-4-ts6
Open

fix: TS5011 errors with TypeScript 6.0: transpileModule called with rootDir: undefined#1695
tweet wants to merge 2 commits into
TypeStrong:webpack-4from
tweet:fix-webpack-4-ts6

Conversation

@tweet
Copy link
Copy Markdown

@tweet tweet commented May 21, 2026

backport change to webpack 4 version

#1678

…ootDir: undefined

backport change to webpack 4 version
@johnnyreilly
Copy link
Copy Markdown
Member

johnnyreilly commented May 21, 2026

If we want to merge and release this we'll also need to migrate this branch to use trusted publishing

@johnnyreilly
Copy link
Copy Markdown
Member

johnnyreilly commented May 22, 2026

I'm considering adding webpack 4 support back directly and not just on 8.x. Could you confirm if the branch in this pull request works for you? #1697

If you yarn build you should be able to plug it into your project and test easily

@tweet
Copy link
Copy Markdown
Author

tweet commented May 25, 2026

I've test this branch's build, but build with failure because of different source-map dependency version used (It's 0.6.1 in my project, but ts-loader needs 0.7.x).
There are some errors as follows.

error  in ./src/xxx/xxx.vue?vue&type=script&lang=ts
Syntax Error: TypeError: sourceMapConsumer.destroy is not a function
    at Array.forEach (<anonymous>)
Syntax Error: TypeError: module.addError is not a function
    at Array.forEach (<anonymous>)

@johnnyreilly
Copy link
Copy Markdown
Member

Ah thanks - let me investigate!

@johnnyreilly
Copy link
Copy Markdown
Member

johnnyreilly commented May 25, 2026

Can you confirm which specific version of webpack 4 you are using please? Also, where is your version of source-map coming from? 0.6.1 I mean.

@johnnyreilly
Copy link
Copy Markdown
Member

I've updated the branch version to guard against unusable versions of source-map - this should resolve your situation I think. I'm still curious as to what brought source-map@0.6.1 into your project?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants