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

Bump webpack-cli and webpack-dev-server from v3 to v4 #10568

Merged
merged 4 commits into from
Mar 21, 2023

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Mar 15, 2023

Bumps webpack-dev-server from 3.11.3 to 4.12.0.

Release notes

Sourced from webpack-dev-server's releases.

v4.12.0

4.12.0 (2023-03-14)

Features

  • allow to set the sockjs_url option (only sockjs) using the webSocketServer.options.sockjsUrl option (#4586) (69a2fba)
  • catch runtime error (#4605) (87a26cf)
  • improve styles for overlay (#4576) (791fb85)
  • open editor when clicking error on overlay (#4587) (efb2cec)

Bug Fixes

v4.11.1

4.11.1 (2022-09-19)

Bug Fixes

  • respect client.logging option for all logs (#4572) (375835c)

v4.11.0

4.11.0 (2022-09-07)

Features

  • make allowedHosts accept localhost subdomains by default (#4357) (0a33e6a)

Bug Fixes

v4.10.1

4.10.1 (2022-08-29)

Bug Fixes

v4.10.0

4.10.0 (2022-08-10)

... (truncated)

Changelog

Sourced from webpack-dev-server's changelog.

4.12.0 (2023-03-14)

Features

  • allow to set the sockjs_url option (only sockjs) using the webSocketServer.options.sockjsUrl option (#4586) (69a2fba)
  • catch runtime error (#4605) (87a26cf)
  • improve styles for overlay (#4576) (791fb85)
  • open editor when clicking error on overlay (#4587) (efb2cec)

Bug Fixes

4.11.1 (2022-09-19)

Bug Fixes

  • respect client.logging option for all logs (#4572) (375835c)

4.11.0 (2022-09-07)

Features

  • make allowedHosts accept localhost subdomains by default (#4357) (0a33e6a)

Bug Fixes

4.10.1 (2022-08-29)

Bug Fixes

4.10.0 (2022-08-10)

Features

  • allow to configure more client options via resource URL (#4274) (216e3cb)

... (truncated)

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

@dependabot dependabot bot added dependencies javascript Pull requests that update Javascript code labels Mar 15, 2023
@dacook dacook self-requested a review March 16, 2023 00:51
@dacook dacook added the blocked label Mar 16, 2023
@dacook
Copy link
Member

dacook commented Mar 16, 2023

It doesn't work :(

$ yarn install
...
$ bin/webpack-dev-server
/Users/dcook/projects/openfoodnetwork/node_modules/webpack-cli/bin/utils/prompt-command.js:46
	return func(...args);
	       ^

TypeError: Class constructor ServeCommand cannot be invoked without 'new'
    at runWhenInstalled (/Users/dcook/projects/openfoodnetwork/node_modules/webpack-cli/bin/utils/prompt-command.js:46:9)
    at promptForInstallation (/Users/dcook/projects/openfoodnetwork/node_modules/webpack-cli/bin/utils/prompt-command.js:140:10)
    at /Users/dcook/projects/openfoodnetwork/node_modules/webpack-cli/bin/cli.js:32:43
    at Object.<anonymous> (/Users/dcook/projects/openfoodnetwork/node_modules/webpack-cli/bin/cli.js:366:3)

@dacook dacook changed the title Bump webpack-dev-server from 3.11.3 to 4.12.0 Bump webpack-cli and webpack-dev-server from v3 to v4 Mar 16, 2023
@dacook dacook added dev-test A dev need to test this one and removed blocked labels Mar 16, 2023
@dacook
Copy link
Member

dacook commented Mar 16, 2023

I think I solved it!
But I don't understand why Dependabot chose not to update webpack-cli earlier.

A month later, webpack-cli v5 was released, but I think we need to do that separately. I wonder if dependabot will open up a PR for that after this is merged..

What should a dev test?

yarn install
foreman start

Copy link
Member

@dacook dacook left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requires someone else to test on their dev environment.

@mkllnk
Copy link
Member

mkllnk commented Mar 20, 2023

Dev test failed. 🔴

The webpack-dev-server raises errors:

ERROR in chunk admin [entry]
js/[name]-[contenthash].js
Cannot use [chunkhash] or [contenthash] for chunk in 'js/[name]-[contenthash].js' (use [hash] instead)

ERROR in chunk admin-styles [entry]
css/admin-styles-fea4a876.css
Cannot use [chunkhash] or [contenthash] for chunk in 'js/[name]-[contenthash].js' (use [hash] instead)

ERROR in chunk admin-styles-v2 [entry]
css/admin-styles-v2-0313b166.css
Cannot use [chunkhash] or [contenthash] for chunk in 'js/[name]-[contenthash].js' (use [hash] instead)

ERROR in chunk application [entry]
js/[name]-[contenthash].js
Cannot use [chunkhash] or [contenthash] for chunk in 'js/[name]-[contenthash].js' (use [hash] instead)

ERROR in chunk darkswarm [entry]
css/darkswarm-4088a64b.css
Cannot use [chunkhash] or [contenthash] for chunk in 'js/[name]-[contenthash].js' (use [hash] instead)

ERROR in chunk mail [entry]
css/mail-783c5a38.css
Cannot use [chunkhash] or [contenthash] for chunk in 'js/[name]-[contenthash].js' (use [hash] instead)

I didn't see it at first because there is other output afterwards but then I tested the auto-reloading after changing CSS and it raised these errors again.

@dependabot @github
Copy link
Contributor Author

dependabot bot commented on behalf of github Mar 20, 2023

A newer version of webpack-dev-server exists, but since this PR has been edited by someone other than Dependabot I haven't updated it. You'll get a PR for the updated version as normal once this PR is merged.

dependabot bot and others added 4 commits March 20, 2023 11:33
Bumps [webpack-dev-server](https://github.com/webpack/webpack-dev-server) from 3.11.3 to 4.12.0.
- [Release notes](https://github.com/webpack/webpack-dev-server/releases)
- [Changelog](https://github.com/webpack/webpack-dev-server/blob/master/CHANGELOG.md)
- [Commits](webpack/webpack-dev-server@v3.11.3...v4.12.0)

---
updated-dependencies:
- dependency-name: webpack-dev-server
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
I don't know why, but Dependabot decided not to: #9798 (comment)

This is required for webpack-dev-server v4.
This now gets included as a dependency of webpack-cli v4. If webpack-cli had been upgraded earlier, we never would have needed to specify this.
Error was:
```
ERROR in chunk admin [entry]
js/[name]-[contenthash].js
Cannot use [chunkhash] or [contenthash] for chunk in 'js/[name]-[contenthash].js' (use [hash] instead)
```
@jibees
Copy link
Contributor

jibees commented Mar 20, 2023

I've commit a fix and rebased the branch. This one requires a strong deployment test I guess.

@jibees jibees force-pushed the dependabot/npm_and_yarn/webpack-dev-server-4.12.0 branch from de0ccda to bfbcdba Compare March 20, 2023 10:36
@dacook
Copy link
Member

dacook commented Mar 21, 2023

Great teamwork.
I just tested (note with updated Node since rebase) and can confirm that error no longer occurs.

The JS, CSS and add to cart all look good.

@dacook
Copy link
Member

dacook commented Mar 21, 2023

I will assume no-one has any other issues and go ahead and merge :)

@dacook dacook merged commit 7ad5181 into master Mar 21, 2023
@dacook dacook deleted the dependabot/npm_and_yarn/webpack-dev-server-4.12.0 branch March 21, 2023 00:47
@dacook dacook self-assigned this Mar 21, 2023
@jibees
Copy link
Contributor

jibees commented Mar 21, 2023

@dacook just to know, did you test a deployment?

Edit:

Capture d’écran 2023-03-21 à 14 11 49

gems/webpacker-5.4.4/lib/webpacker/manifest.rb:79:in `handle_missing_entry': Webpacker can't find logo-white-notext.png in /home/openfoodnetwork/apps/openfoodnetwork/releases-old/2023-03-21-130502/public/packs/manifest.json. Possible causes:
1. You want to set webpacker.yml value of compile to true for your environment
   unless you are using the `webpack -w` or the webpack-dev-server.
2. webpack has not yet re-run to reflect updates.
3. You have misconfigured Webpacker's config/webpacker.yml file.
4. Your webpack configuration is not creating a manifest.
Your manifest contains:
{
}
 (ActionView::Template::Error)
    from gems/webpacker-5.4.4/lib/webpacker/manifest.rb:49:in `lookup!'
    from gems/webpacker-5.4.4/lib/webpacker/helper.rb:193:in `rescue in resolve_path_to_image'
    from gems/webpacker-5.4.4/lib/webpacker/helper.rb:189:in `resolve_path_to_image'
    from config/initializers/webpack.rb:6:in `image_pack_path'
    from app/views/home/_tagline.html.haml:5:in `_app_views_home__tagline_html_haml__2572215756437575251_120080'
  • Logged on server, directory packs doesn't exist under /home/openfoodnetwork/apps/openfoodnetwork/releases-old/2023-03-21-130502/public
ls: cannot access '/home/openfoodnetwork/apps/openfoodnetwork/releases-old/2023-03-21-130502/public/packs': No such file or directory

(partial) conclusion: Opening an issue, as it's not that simple...

@dacook
Copy link
Member

dacook commented Mar 21, 2023

@dacook just to know, did you test a deployment?

🤦 Oh no, sorry I didn't even though you made it very clear! I was thinking "development" test.. because it was affecting devDependencies only.

I don't understand how this could have affected deployment, but it seems like this update is the cause. Thanks so much for responding to this with a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies dev-test A dev need to test this one javascript Pull requests that update Javascript code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants