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

4.x - min.js build error #5994

Closed
1 task done
luu-alex opened this issue Apr 6, 2023 · 3 comments
Closed
1 task done

4.x - min.js build error #5994

luu-alex opened this issue Apr 6, 2023 · 3 comments
Assignees
Labels
4.x 4.0 related Bug Addressing a bug

Comments

@luu-alex
Copy link
Contributor

luu-alex commented Apr 6, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Screenshot 2023-04-06 at 1 36 12 AM

running into a build error with CRA. browser build issue that needs to be investigated

Expected Behavior

Should work fine

Steps to Reproduce

create CRA project with 4.x

Web3.js Version

4

Environment

  • Operating System:
  • Browser:
  • Node.js Version:
  • NPM Version:

Anything Else?

No response

@luu-alex luu-alex added Bug Addressing a bug 4.x 4.0 related labels Apr 6, 2023
@jdevcs
Copy link
Contributor

jdevcs commented Apr 6, 2023

Seems create react app doesn't fully support ESM out of box. facebook/create-react-app#10933
@luu-alex can you force via config to load CJS from 4.x lib or try https://www.npmjs.com/package/react-app-rewired-esm

Its due to ESM, fully qualified names are required in our lib code and we can hint node for that using --experimental-specifier-resolution=node #5904 (comment) , but in case of CRA its not considering this flag.

@luu-alex
Copy link
Contributor Author

Screenshot 2023-05-31 at 4 45 47 PM Now we stopped running into esm issues, its back being polyfill errors like in 1.x, i think we could get rid of the polyfills after the release and work on that. not sure how hard that would be, i think marin said it might take some work.

I dont think forcing cjs will work since its a polyfill issue, I think if people want to use web3js in CRA or angular we can provide them a cdn min.js build. thoughts?

@luu-alex
Copy link
Contributor Author

luu-alex commented Jun 1, 2023

esm issue is now fixed, Created new issue to remove the polyfills

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x 4.0 related Bug Addressing a bug
Projects
None yet
Development

No branches or pull requests

3 participants