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

NextJS v13.0.1 breaks transpile #282

Closed
1 of 2 tasks
dohomi opened this issue Nov 1, 2022 · 7 comments
Closed
1 of 2 tasks

NextJS v13.0.1 breaks transpile #282

dohomi opened this issue Nov 1, 2022 · 7 comments

Comments

@dohomi
Copy link

dohomi commented Nov 1, 2022

  • I HAVE READ THE FAQ AND MY PROBLEM WAS NOT DESCRIBED THERE
  • I WILL GIVE 10$ TO CHARITY IF MY SOLUTION WAS ACTUALLY IN THE README/FAQ

Describe the bug
From NextJS 13.0.0 => 13.0.1 next stops compiling.

To Reproduce
Upgrade NextJS 13.0.0. => 13.0.1 with a pages folder structure.

TypeError: Cannot read properties of undefined (reading 'and')

Expected behavior
NextJS 13.0.0 works fine, without any code change.

Setup

  • Next.js version: 13.0.1
  • next-transpile-modules version: 9.1.0
  • Node.js version: 16
@eugenejeonme
Copy link

eugenejeonme commented Nov 1, 2022

I hope this issue is resolved soon.
And I found, secondary way to make it work.
Using the experimental.transpilePackages option of NextJS Config.

https://beta.nextjs.org/docs/api-reference/next.config.js#transpilepackages

@martpie
Copy link
Owner

martpie commented Nov 1, 2022

Thank you very much for the report! It would seem their fix for the duplicated code in bundles have broken ntm.

On a sidenote, we don't officially support Next 13 yet.

Cf. #281

Regarding transpilePackages, be wary it's not a 1-to-1 replacement and it's still an experimental feature.

Cf. vercel/next.js#42136 for the feature gap.

@terrymun
Copy link

terrymun commented Nov 1, 2022

Thanks for opening the ticket @dohomi, we have encountered the same issue as well. This seems to be coming from a change introduced in 13.0.1 originating from this PR on NextJS: https://github.com/vercel/next.js/pull/42106/files

The issuer field has been removed :( and next-transpile-module relies on this field here: https://github.com/martpie/next-transpile-modules/blob/master/src/next-transpile-modules.js#L206

I am wondering if it's something we can patch for this, or it's something for NextJs maintainers to do (i.e. restore the issuer field)?

@martpie
Copy link
Owner

martpie commented Nov 1, 2022

Thank you for identifying the faulty commit, that will help a lot 👍

Please note that Next.js 13 is not yet supported by next-transpile-modules.

You can check #281 for work in progress

@terrymun
Copy link

terrymun commented Nov 1, 2022

I've created a support ticket on NextJs repo to see if it's something they can fix for the moment being :) vercel/next.js#42296

@eugenejeonme We tried your solution of using the experimental transpilation flag, but as we are using Nx the issue simply bubbles up to with-nx.ts and fails in the similar way as it failed on next-transpile-modules.

@terrymun
Copy link

terrymun commented Nov 1, 2022

@martpie We are indeed pushing our luck with the NextJs@13 upgrade, but so far everything worked perfectly with your plugin :)

@martpie
Copy link
Owner

martpie commented Nov 1, 2022

Fixed in next-transpile-modules@10.0.0, cheers!

@martpie martpie closed this as completed Nov 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants