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

[bug] SWC introduction in v0.11.0 increases bundle size and leads to Nextjs API functions deployment failures. #325

Closed
jeremytenjo opened this issue Jun 29, 2023 · 3 comments

Comments

@jeremytenjo
Copy link

jeremytenjo commented Jun 29, 2023

Deploying Nextjs apps that contain API routes fail because SWC package sizes are big.

The following error occurs when deploying the Nextjs app.

image

Leads to

image

Additional context
I had to downgrade to v0.10.0.

This issue shows the broader effects of SWC in Nextjs apps.

vercel/next.js#42641

Thanks! :)

@jeremytenjo jeremytenjo changed the title [bug] SWC introduction in v0.11.0 increases bundle size and leads to Nextjs API functions deploys failures. [bug] SWC introduction in v0.11.0 increases bundle size and leads to Nextjs API functions deployment failures. Jun 29, 2023
@bryanjtc
Copy link
Member

bryanjtc commented Jun 29, 2023

SWC is only used for transforming tsx, js, ts, jsx files in a storybook project. Why it is related to your next.js app? Is your next.js app bundling @storybook/test-runner?

@jeremytenjo
Copy link
Author

I see, looks like this is more of a Nextjs issue. I will create a new ticket there.

Thanks @bryanjtc !

@jeremytenjo
Copy link
Author

I got it to work with the following outputFileTracingExcludes values in the next.config.js (Nextjs v13.4.8)

   experimental: {
      outputFileTracingExcludes: {
        '*': [
          'node_modules/@swc/core-linux-x64-gnu',
          'node_modules/@swc/core-linux-x64-musl',
          'node_modules/@esbuild/linux-x64',
        ],
      },
    },

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

2 participants