-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Fix bundler issue with webpack 5 #1862
Conversation
As explained in issue #1844 and in issue webpack/webpack#15007 (comment), the way we used the `browser`-field was wrong. The main reason for using the `browser`-field is the requirement of `require('fs')` in the main-entry-file. The workaround for this was using `require('handlebars/lib/handlebars')`, but now it will also work via `require('handlebars')` for bundlers that respect the `browser`-field. The `"./runtime"`-config was removed, because it didn't have any effect. In order to detect regressions, the webpack-integration test was extended to test with different webpack versions. Fixes #1174 Closes #1844
has this fix been released? |
I've tried doing that, but it just exposes a new error:
Will this fix be released soon? I see on npmjs.com that the last release was 2 years ago? |
Do we know when this might be released to NPM? This is blocking my project from upgrading to latest create react app... |
I'll try to get it done this week. 🤞 |
May I ask when will this be released? it's already 2023 |
I hope this gets merged soon. For those having issues doing this workaround in Typescript, Here's what I did: create a type definition file:
imports will be like this:
usage is:
|
Glad that this is merged. I hope this fix will be released soon. @karlo-humanmanaged I got Typescript complaining from your workaround:
Here's mine: Create a type definition file
Import like this:
Usage:
|
@jaylinski Any updates on this? |
@jaylinski update plz |
I released a new patch version (v4.7.8) on npm. Sorry it took so long. |
As explained in issue #1844 and in issue
webpack/webpack#15007 (comment),
the way we used the
browser
-field was wrong.The main reason for using the
browser
-field is the requirement ofrequire('fs')
in the main-entry-file.The workaround for this was using
require('handlebars/lib/handlebars')
,but now it will also work via
require('handlebars')
for bundlers thatrespect the
browser
-field.The
"./runtime"
-config was removed, because it didn't have any effect.In order to detect regressions, the webpack-integration test was
extended to test with different webpack versions.
Fixes #1174
Closes #1844