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

Webpack 5 Support Plan? #1269

Closed
septs opened this issue Sep 9, 2019 · 15 comments
Closed

Webpack 5 Support Plan? #1269

septs opened this issue Sep 9, 2019 · 15 comments

Comments

@septs
Copy link

septs commented Sep 9, 2019

The webpack 5.0 changelog
https://github.com/webpack/changelog-v5/blob/master/README.md

@jantimon

@jantimon
Copy link
Owner

jantimon commented Sep 9, 2019

It is not possible to support webpack 4 and webpack 5 with one version

Therefore I would like to release html-webpack-plugin 4 first before deprecating it 😄

@septs
Copy link
Author

septs commented Sep 16, 2019

@jantimon Will the next version migrate to TypeScript?

@jantimon
Copy link
Owner

jantimon commented Sep 16, 2019

We are already using typescript salsa https://www.typescriptlang.org/docs/handbook/type-checking-javascript-files.html#supported-jsdoc

We would like to do better but this is blocked by microsoft/TypeScript#7546

@septs
Copy link
Author

septs commented Sep 16, 2019

I hope to expose the definition of getHooks in typings.d.ts.
I am developing a plugin based on html-webpack-plugin.

@septs
Copy link
Author

septs commented Sep 17, 2019

@jantimon

@jantimon
Copy link
Owner

If you enable allowJs in your tsconfig it should work :)

@septs
Copy link
Author

septs commented Sep 18, 2019

Pure TypeScript Project, Enable strict-mode.

@jantimon
Copy link
Owner

That should work fine

@hanzenok
Copy link

hanzenok commented Oct 4, 2019

@jantimon Dont know if it is a good place to ask but are there any dates on new release?

Testing the 4.0.0-beta.8 and it's quite a performance booster!

@septs
Copy link
Author

septs commented Oct 12, 2019

@jantimon webpack 5 release, first beta version.
https://github.com/webpack/webpack/releases/tag/v5.0.0-beta.0

@rwieruch
Copy link

rwieruch commented Oct 19, 2019

Initially 4.0.0-beta.8 works with Webpack 5.0.0-beta.0. rwieruch/advanced-react-webpack-babel-setup@d2e6d58

But once I change source code, I run into webpack/webpack#9802 (comment):

/Users/mydspr/Developer/Repos/advanced-react-webpack-babel-setup/node_modules/html-webpack-plugin/lib/compiler.js:341
    const timestamp = fileTimestamps.get(fileDependency);
                                     ^

TypeError: Cannot read property 'get' of undefined
    at childCompiler.fileDependencies.some (/Users/mydspr/Developer/Repos/advanced-react-webpack-babel-setup/node_modules/html-webpack-plugin/lib/compiler.js:341:38)
    at Array.some (<anonymous>)
    at isChildCompilerCacheOutdated (/Users/mydspr/Developer/Repos/advanced-react-webpack-babel-setup/node_modules/html-webpack-plugin/lib/compiler.js:340:59)
    at Object.hasOutDatedTemplateCache (/Users/mydspr/Developer/Repos/advanced-react-webpack-babel-setup/node_modules/html-webpack-plugin/lib/compiler.js:321:16)
    at compiler.hooks.thisCompilation.tap (/Users/mydspr/Developer/Repos/advanced-react-webpack-babel-setup/node_modules/html-webpack-plugin/index.js:135:25)
    at Hook.eval [as call] (eval at create (/Users/mydspr/Developer/Repos/advanced-react-webpack-babel-setup/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:7:1)
    at Compiler.newCompilation (/Users/mydspr/Developer/Repos/advanced-react-webpack-babel-setup/node_modules/webpack/lib/Compiler.js:713:30)
    at hooks.beforeCompile.callAsync.err (/Users/mydspr/Developer/Repos/advanced-react-webpack-babel-setup/node_modules/webpack/lib/Compiler.js:754:29)
    at Hook.eval [as callAsync] (eval at create (/Users/mydspr/Developer/Repos/advanced-react-webpack-babel-setup/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
    at Compiler.compile (/Users/mydspr/Developer/Repos/advanced-react-webpack-babel-setup/node_modules/webpack/lib/Compiler.js:749:28)

See also #1292

@kirill-konshin
Copy link

Somehow HTML plugin is causing this error:

ERROR in   TypeError: Cannot read property 'tap' of undefined
  
  - ExternalModuleFactoryPlugin.js:17 ExternalModuleFactoryPlugin.apply
    [web-modules-core]/[webpack]/lib/ExternalModuleFactoryPlugin.js:17:37
  
  - ExternalsPlugin.js:16 
    [web-modules-core]/[webpack]/lib/ExternalsPlugin.js:16:63
  
  
  - Hook.js:14 Hook.CALL_DELEGATE [as _call]
    [build]/[tapable]/lib/Hook.js:14:14
  
  - Compiler.js:890 
    [build]/[webpack]/lib/Compiler.js:890:23
  
  
  - Hook.js:18 Hook.CALL_ASYNC_DELEGATE [as _callAsync]
    [build]/[tapable]/lib/Hook.js:18:14
  
  - Compiler.js:887 Compiler.compile
    [build]/[webpack]/lib/Compiler.js:887:28
  
  - Compiler.js:432 Compiler.runAsChild
    [build]/[webpack]/lib/Compiler.js:432:8
  
  - compiler.js:129 
    [web-modules-core]/[html-webpack-plugin]/lib/compiler.js:129:21

When I remove HTML plugin from config everything works.

@jantimon
Copy link
Owner

The problem is this bug: #1129

@kirill-konshin
Copy link

Seems that it's working now, version 4.2.0?

@jantimon
Copy link
Owner

Yes 4.2.0 supports webpack 5

@lock lock bot locked as resolved and limited conversation to collaborators May 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants