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

13.0.3+13.0.4 production builds cause some external libraries to misbehave #42852

Closed
1 task done
apancutt opened this issue Nov 13, 2022 · 17 comments · Fixed by #42977
Closed
1 task done

13.0.3+13.0.4 production builds cause some external libraries to misbehave #42852

apancutt opened this issue Nov 13, 2022 · 17 comments · Fixed by #42977
Assignees

Comments

@apancutt
Copy link

Verify canary release

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

Provide environment information

    Operating System:
      Platform: darwin
      Arch: arm64
      Version: Darwin Kernel Version 22.1.0: Sun Oct  9 20:15:09 PDT 2022; root:xnu-8792.41.9~2/RELEASE_ARM64_T6000
    Binaries:
      Node: 18.11.0
      npm: 8.19.2
      Yarn: 3.2.4
      pnpm: N/A
    Relevant packages:
      next: 13.0.3
      eslint-config-next: 13.0.3
      react: 18.2.0
      react-dom: 18.2.0

What browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

Describe the Bug

Production builds of next 13.0.3 cause luxon to break - I suspect the impact is more widespread than just this library hence reporting here.

Development builds work fine.

The specific issue I'm seeing is that DateTime.now().toISO() should return an ISO date-time string (e.g 2022-11-13T00:00:00+1:00). In 13.0.3 I just receive the GMT offset part (e.g. +1:00).

Versions <= 13.0.2 are fine; canary is broken.

Expected Behavior

Production builds should not break applications.

Production builds should not differ in behavior to development builds.

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

https://stackblitz.com/edit/vercel-next-js-ph9din

To Reproduce

See reproduction for example code.

Create a build (next build) and start the server (next start) and see that only the timezone offset is displayed.

@apancutt apancutt added the bug Issue was opened via the bug report template. label Nov 13, 2022
@mutewinter
Copy link

mutewinter commented Nov 14, 2022

I had a similar issue with another library and I was able to fix the issue in 13.0.3 by setting swcMinify: false. I believe the issue is fixed here: #42790.

Also related #42878

@apancutt
Copy link
Author

apancutt commented Nov 15, 2022

I'm unable to test since 13.0.4-canary.0 has not been published yet and attempts to install using a github URL fails with Error: next@https://github.com/vercel/next.js.git#commit=df3ddec1085ad4231cd655b5f99e070db99c0d03: Assertion failed: Unsupported workflow (Yarn3).

This isn't the first time - and won't be the last - that SWC minification causes discrepancies between dev and prod. Why not enable minification in dev? I'd rather it took an extra few ms for a hot reload in dev than find out the app is completely broken in staging/production.

Could this at least be made an opt-in option?

@kolorfilm
Copy link

Hi there, I have the same problem with a third party package that makes a callback back to the next backend (redirect url from a ssoLib package). The link is resolved wrong and so it will not be redirected correctly. Like @mutewinter mentioned swcMinify: false helped for me as well.

@iscekic
Copy link

iscekic commented Nov 15, 2022

Issue seems to affect hls.js video-dev/hls.js#5015 and other libraries - swcMinify: false confirmed as workaround.

@balazsorban44 balazsorban44 added kind: bug and removed bug Issue was opened via the bug report template. labels Nov 15, 2022
@balazsorban44
Copy link
Member

We published 13.0.4-canary.1, but I could still reproduce this, so marking as a bug. We will look into this!

@apancutt
Copy link
Author

Just to confirm, still an issue in 13.0.4.

@apancutt apancutt changed the title 13.0.3 production builds cause some external libraries to misbehave 13.0.3+13.0.4 production builds cause some external libraries to misbehave Nov 18, 2022
@niranjan94
Copy link

Same issue with noVNC swcMinify: false as workaround fixes it
#43042 (comment)

@davecarlson
Copy link
Contributor

This also breaks luxon.

See moment/luxon#1328

@karlhorky
Copy link
Contributor

@kdy1 @ijjk The hls.js@1.2.5 issue is still present with next@13.0.5, is there still an issue with minification? (eg. maybe also including web workers?)

@kdy1
Copy link
Member

kdy1 commented Nov 24, 2022

@karlhorky Yes, but it's a different issue

@karlhorky
Copy link
Contributor

karlhorky commented Nov 24, 2022

Ok, is this planned on being fixed in Next.js / SWC too? Maybe this issue should be reopened to track this?

@kdy1
Copy link
Member

kdy1 commented Nov 24, 2022

I made swc-project/swc#6504 instead

@karlhorky
Copy link
Contributor

karlhorky commented Nov 24, 2022

Great, thanks! Subscribed over there.

Maybe once it's fixed, you can also mention over in that other issue which Next.js release it will be published in (or here, also an option).

@kdy1
Copy link
Member

kdy1 commented Nov 24, 2022

I'll update next.js once I fix all easily fixable minifier issues and once again when I fix others too.
But I'm not sure about the version.

@kolorfilm
Copy link

From my perspective I can confirm the issue is fixed. The client sso library package works without any issues and swcMinify is on. Thanks! 🚀

@karlhorky
Copy link
Contributor

karlhorky commented Nov 29, 2022

New PR in Next.js to update to fixed SWC version:

@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 Dec 30, 2022
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.

9 participants