Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

jaylinski
Copy link
Member

Backport of #1862 and b3b2671.

jaylinski added 2 commits May 17, 2022 21:07
Fixes the following error when running integration-tests:
```
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/handlebars
npm ERR!   dev handlebars@"file:../../.." from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer handlebars@">= 1.3.0 < 5" from [email protected]
npm ERR! node_modules/handlebars-loader
npm ERR!   dev handlebars-loader@"^1.7.1" from the root project
npm ERR!
```
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
@jaylinski jaylinski self-assigned this May 17, 2022
@jaylinski jaylinski merged commit e3a5448 into 4.x May 17, 2022
@jaylinski jaylinski deleted the backport-1862 branch May 17, 2022 19:19
@jaylinski jaylinski changed the title Backport 1862 Backport #1862 May 25, 2022
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.

1 participant