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

Add support for Webpack 5 message objects #10121

Merged
merged 2 commits into from
May 30, 2021

Conversation

jasonwilliams
Copy link
Contributor

@jasonwilliams jasonwilliams commented Nov 20, 2020

In webpack 4 message is a string, in webpack 5 it is an object or array.
See conversation here: #7929 (comment)

Closes #9880.

@raix
Copy link
Contributor

raix commented Dec 4, 2020

also seem related to #10098

@devashissh
Copy link

When is this fix going to be merged?

@clwilkening
Copy link

Would love for this fix to get merged.
Is there any update?

@mrmckeb mrmckeb mentioned this pull request May 30, 2021
Copy link
Contributor

@mrmckeb mrmckeb left a comment

Choose a reason for hiding this comment

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

Based on feedback from @raix, we'll merge this in.

I've tested and this still works as expected for Webpack 4.x users.

@mrmckeb mrmckeb added this to the 4.1 milestone May 30, 2021
@mrmckeb mrmckeb merged commit b172b5e into facebook:master May 30, 2021
wombleton pushed a commit to AurorNZ/create-react-app that referenced this pull request Jun 1, 2021
Co-authored-by: Brody McKee <mrmckeb@gmail.com>
@baryman
Copy link

baryman commented Jun 8, 2021

Hello, friends. How long will it take for this merge request to be published?

@PadminRK
Copy link

Team, please can you let know when this fix is expected to be published?

@mrmckeb
Copy link
Contributor

mrmckeb commented Jun 22, 2021

This is due in the next release, but I can't say exactly when. It should be in the next few weeks :)

@robaweb
Copy link

robaweb commented Jul 6, 2021

Could someone create a beta-test tag for the commit b172b5e?_pjax=%23js-repo-pjax-container in the package react-dev-utils (npm, yarn), please? It will be great, we really need it!

@indykish
Copy link

indykish commented Jul 9, 2021

@mrmckeb When are you guys release the minor release?

@mrmckeb
Copy link
Contributor

mrmckeb commented Jul 9, 2021

This will now be a major release sorry, we're hoping to have an alpha out very soon.

@indykish
Copy link

indykish commented Jul 9, 2021

@mrmckeb Any target dates - ball park ?

We used patch-package for now to fix this though.

Thank you for your time.

@noahgrant
Copy link

Just curious—why wasn't this added as a patch release, since it's a bugfix that it seems a bunch of people are relying on?

@raix
Copy link
Contributor

raix commented Jul 11, 2021

@kishoreneelamegam we should be within weeks before v5 alpha (hopefully within two weeks but mind vaccation etc.)

@noahgrant we are aware of lagging releases and working on improving this.

@indykish
Copy link

indykish commented Jul 11, 2021

@raix Thank you. No worries

For folks looking for a work around:

Step 1: Move yarn version to 1, if on yarn 2

yarn set version 1

Step 2: Add the latest (6.4.7) patch-package and postinstall-postinstall in package.json

And in the scripts in your package.json

scripts: {
"postinstall": "patch-package"
...
}

Step 3: Do a yarn install

Step 4: Apply the below file in node_modules/react-dev-utils/formatWebpackMessages.js

https://github.com/jasonwilliams/create-react-app/blob/d60198cce48b44d7e2fbbe457754b7e85685ebd5/packages/react-dev-utils/formatWebpackMessages.js

Run the below

yarn patch-package react-dev-hot-utils

A patches/ directory will be auto created with the patch name.

This assumes that you are using node_modules (nodeLinker in .yarnrc.yml) is used in yarn 2

Step 5: Switch back to yarn 2

yarn set version latest

Step 6: yarn install again

The patch will be applied. You will not see the .split error now.

@mwanagosos
Copy link

Are there any plans on releasing it anytime soon?

sumanthratna pushed a commit to sumanthratna/create-react-app that referenced this pull request Aug 4, 2021
Co-authored-by: Brody McKee <mrmckeb@gmail.com>
@raix
Copy link
Contributor

raix commented Sep 9, 2021

It's currently released in alpha

@hunter-digital
Copy link

hunter-digital commented Sep 9, 2021

@raix I'm still experiencing this issue when using a CRA build that uses a custom react-scripts and cra-template. These two forks are both largely unmodified, and are based off of the most recent version of CRA. I can see the fix applied in my CRA's packages/react-dev-utils version.

When I do npm info react-dev-utils on the generated app, it says 11.0.4 as expected, but when I view the file in package.json, it does not have the fix applied. Why is it pulling in an older version of react-dev-utils? Is it possible to edit my react-scripts fork to depend on a version that does have the fix?

In other words this tarball does not have the fix:
https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-11.0.4.tgz

But the 11.0.4 react-dev-utils here does have it:
https://github.com/facebook/create-react-app/tree/main/packages/react-dev-utils

@raix
Copy link
Contributor

raix commented Sep 10, 2021

Odd, not sure if npm has a problem in using prereleases react-dev-utils should be at v12 https://www.npmjs.com/package/react-dev-utils

Maybe try if yarn got the same issue?

@drschulz
Copy link

For those looking for the new dev tools version in npm (as of this post it's next.37), you can find v12 in the versions tab here https://www.npmjs.com/package/react-dev-utils, and then can just update your package json to:

"react-dev-utils": "^12.0.0-next.37",

abhiisheek pushed a commit to abhiisheek/create-react-app that referenced this pull request May 24, 2023
Co-authored-by: Brody McKee <mrmckeb@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[V4] Message formatting is incompatible with Webpack v5