Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read property 'getTypes' of undefined on rename when using MultiCompiler and webpack-dev-middleware #13330

Closed
meskill opened this issue May 8, 2021 · 0 comments

Comments

@meskill
Copy link

meskill commented May 8, 2021

Bug report

What is the current behavior?

When using MultiCompiler, webpack node-api and compiler hook that gets stats from compilation (like webpack-dev-middleware do) - file rename leads to Error

TypeError: Cannot read property 'getTypes' of undefined
    at NormalModule.getSourceTypes (/workspaces/js-ts/webpack5-stats-watch-error/webpack5/node_modules/webpack/lib/NormalModule.js:1059:25)
    at _ (/workspaces/js-ts/webpack5-stats-watch-error/webpack5/node_modules/webpack/lib/stats/DefaultStatsFactoryPlugin.js:1086:36)
    at /workspaces/js-ts/webpack5-stats-watch-error/webpack5/node_modules/webpack/lib/stats/DefaultStatsFactoryPlugin.js:2245:9
    at Hook.eval [as call] (eval at create (/workspaces/js-ts/webpack5-stats-watch-error/webpack5/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:7:16)
    at /workspaces/js-ts/webpack5-stats-watch-error/webpack5/node_modules/webpack/lib/stats/StatsFactory.js:277:7
    at StatsFactory._forEachLevel (/workspaces/js-ts/webpack5-stats-watch-error/webpack5/node_modules/webpack/lib/stats/StatsFactory.js:100:19)
    at StatsFactory._create (/workspaces/js-ts/webpack5-stats-watch-error/webpack5/node_modules/webpack/lib/stats/StatsFactory.js:276:9)
    at StatsFactory.create (/workspaces/js-ts/webpack5-stats-watch-error/webpack5/node_modules/webpack/lib/stats/StatsFactory.js:137:16)
    at /workspaces/js-ts/webpack5-stats-watch-error/webpack5/node_modules/webpack/lib/stats/StatsFactory.js:215:24
    at Array.map (<anonymous>)

If the current behavior is a bug, please provide the steps to reproduce.

Here is test repo

What is the expected behavior?

No error should happen as it is for a single compiler case

Other relevant information:
webpack version: 5.36.2
Node.js version: 14.15.1

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

No branches or pull requests

3 participants