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

using @w3ui/react-uploader UploaderProvider in a Next.js app with SWC minification enabled breaks in production builds #43052

Closed
1 task done
travis opened this issue Nov 17, 2022 · 2 comments · Fixed by #43983
Assignees

Comments

@travis
Copy link

travis commented Nov 17, 2022

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
  Platform: darwin
  Arch: x64
  Version: Darwin Kernel Version 21.4.0: Fri Mar 18 00:45:05 PDT 2022; root:xnu-8020.101.4~15/RELEASE_X86_64
Binaries:
  Node: 16.13.1
  npm: 8.1.2
  Yarn: 1.22.19
  pnpm: 7.13.4
Relevant packages:
  next: 13.0.4-canary.3
  eslint-config-next: 13.0.3
  react: 18.2.0
  react-dom: 18.2.0

What browser are you using? (if relevant)

Brave Version 1.45.127 Chromium: 107.0.5304.110 (Official Build) (x86_64)

How are you deploying your application? (if relevant)

next start

Describe the Bug

If I use the UploaderProvider from w3ui/react-uploader in my app it works fine in dev mode (npm run dev) but the app throws errors (https://reactjs.org/docs/error-decoder.html/?invariant=130&args[]=undefined&args[]= and https://reactjs.org/docs/error-decoder.html/?invariant=423) when run in a production build with SWC minification enabled (npm run build && npm start).

Disabling SWC minification in Next 12, 13 or canary fixes the issue.

Expected Behavior

Apps using UploaderProvider should work the same in development and production mode, with SWC minification enabled or disabled.

Link to reproduction - Issues with a link to complete (but minimal) reproduction code will be addressed faster

https://github.com/web3-storage/w3ui-swc-minify-bug

To Reproduce

Clone https://github.com/web3-storage/w3ui-swc-minify-bug and run npm install && npm run build && npm start and then visit http://localhost:3000

Disable SWC minification (as demonstrated on this branch https://github.com/web3-storage/w3ui-swc-minify-bug/tree/fixed) to fix this issue. The issue also does not occur when running with npm run dev.

@travis travis added the bug Issue was opened via the bug report template. label Nov 17, 2022
@balazsorban44 balazsorban44 added area: SWC Minify and removed bug Issue was opened via the bug report template. labels Nov 18, 2022
@kdy1 kdy1 self-assigned this Nov 18, 2022
@kdy1
Copy link
Member

kdy1 commented Dec 4, 2022

I checked if #43449 is a fix, but seems like this was a different issue.
I'll work on this next week (as a task with the highest priority)

kdy1 added a commit to swc-project/swc that referenced this issue Dec 13, 2022
ijjk pushed a commit that referenced this issue Dec 19, 2022
Fixes WEB-301. 

This PR fixes build failure with latest turbopack, also update necessary
dependencies.

---

Edit by @kdy1:
 - Closes #43052
@github-actions
Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants