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 build error #174

Closed
mickdelaney opened this issue May 1, 2021 · 5 comments
Closed

webpack 5 build error #174

mickdelaney opened this issue May 1, 2021 · 5 comments

Comments

@mickdelaney
Copy link

  • babel-plugin-macros version: ^3.0.1
  • node version: v15.4.0
  • npm version: 7.0.15

Relevant code or config

What you did:
I'm trying to setup react, typescript with relay using webpack 5.
I've done this successfully with CRA, but wanted a more customizable config, and also am assessing if i can move to webpack 5.
All goes well until i add relay, which relies on babel-plugin-macros.

NOTE: I've attempted to polyfill node for webpack 5.

https://github.com/mickdelaney/react-webpack-5-ts-relay/blob/master/webpack.config.js#L15

What happened:

the full build error is here:
https://gist.github.com/mickdelaney/65cedc2e131a1e45edec18a4fb39c68d

Reproduction repository:

https://github.com/mickdelaney/react-webpack-5-ts-relay

Problem description:

Suggested solution:

I'm not an expert on these tools, so am considering just waiting a few months assuming things will stabilize with webpack 5 etc.

@apuntovanini
Copy link

apuntovanini commented May 13, 2021

Can confirm same issue with relay as well, but it came out when I added a dependency which also relies on babel-plugin-macros (twin.macro in particular)

EDIT:
Probably it's "just" versions conflicting

├─ @rails/webpacker@npm:6.0.0-beta.7
│  └─ babel-plugin-macros@npm:3.1.0 (via npm:^3.0.1)
│
├─ babel-plugin-emotion@npm:10.2.2
│  └─ babel-plugin-macros@npm:2.8.0 (via npm:^2.0.0)
│
├─ babel-plugin-relay@npm:11.0.2
│  └─ babel-plugin-macros@npm:2.8.0 (via npm:^2.0.0)
│
├─ babel-plugin-relay@npm:11.0.2 [6f433]
│  └─ babel-plugin-macros@npm:2.8.0 (via npm:^2.0.0)
│
├─ twin.macro@npm:2.4.1
│  └─ babel-plugin-macros@npm:2.8.0 (via npm:^2.8.0)
│
└─ uidu@workspace:.
   └─ babel-plugin-macros@npm:3.1.0 (via npm:^3.1.0)

@mickdelaney
Copy link
Author

fix, i've sort of figured out where i was going wrong.

a few things: https://github.com/mickdelaney/react-webpack-5-ts-relay/compare/fix-issue

happy to close this now.

@conartist6
Copy link
Collaborator

Hmm, can you leave a quick summary of what you learned here in case it helps future users?

@mickdelaney
Copy link
Author

Sure. Will do. Probably Monday/Tuesday. Friday Evening time here 😉

@conartist6
Copy link
Collaborator

Closing this since it appears to be inactive. If anyone else encounters this problem bug @mickdelaney 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants