next.js: 13.0.3+13.0.4 production builds cause some external libraries to misbehave

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.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 5
  • Comments: 17 (10 by maintainers)

Commits related to this issue

Most upvoted comments

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

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: https://github.com/vercel/next.js/pull/42790.

Also related #42878