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

error @next/swc-darwin-x64@11.1.2: The platform "linux" is incompatible with this module. error Found incompatible module. #37651

Closed
1 task done
joeelmahallawy opened this issue Jun 13, 2022 · 9 comments
Labels
please add a complete reproduction The issue lacks information for further investigation

Comments

@joeelmahallawy
Copy link

joeelmahallawy commented Jun 13, 2022

Verify canary release

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

Provide environment information

I get this error when trying to deploy on Vercel:
error @next/swc-darwin-x64@11.1.2: The platform "linux" is incompatible with this module.
error Found incompatible module.

I removed "@next/swc-darwin-x64" from my package.json and added a .babelrc file with: { "presets": ["next/babel"] } in it.

When I removed it, I had a glitch In production where my CSS was messed up for the first 0.5 second when I loaded any page (might be a SSR issue or babel issue) but I'm not sure and would love some help. If anyone knows how to fix the SWC issue or CSS issue, please let me know! Thanks.

What browser are you using? (if relevant)

Brave

How are you deploying your application? (if relevant)

Vercel

Describe the Bug

I get this error when deploying my Next.js app to Vercel:
error @next/swc-darwin-x64@11.1.2: The platform "linux" is incompatible with this module.
error Found incompatible module.

Expected Behavior

To deploy sucessfully.

To Reproduce

Not sure how to reproduce this, but I have: "@next/swc-darwin-x64": "^11.1.2" in my package.json. I think this issue has been resolved in #34989 but I'm not sure how it was fixed. When I remove "@next/swc-darwin-x64": "^11.1.2" from my package.json, I run into babel performance issues as mentioned above.

@joeelmahallawy joeelmahallawy added the bug Issue was opened via the bug report template. label Jun 13, 2022
@balazsorban44
Copy link
Member

You should not be adding @next/swc-darwin-x64 as mentioned here: #34989 (comment)

When you add a Babel file, SWC won't be used at all. It's hard to know why there would be a flash, but since you are on an older version of Next.js, you might want to try canary first and see if your issue has been fixed already.

Without a reproduction, it's hard to tell what might cause the flicker, so please add one, so we can help you investigate.

@balazsorban44 balazsorban44 added please add a complete reproduction The issue lacks information for further investigation and removed bug Issue was opened via the bug report template. labels Jun 13, 2022
@joeelmahallawy
Copy link
Author

I removed @next/swc-darwin-x64 and it deployed successfully (thanks!) but I'm still getting a flicker when I load any page on my app.

I believe I'm using the most recent version of Next.js, my package.json contains: "next": "^12.1.6"

I still want to use SWC, it might fix the flicker issue but I'm not 100% sure. I added in a quick recording for you to see it for yourself – I'm not sure if this is sufficient enough for a reproduction, but let me know if there's anything else I can provide. Please note that this repo is also private, thanks.

Screen.Recording.2022-06-13.at.12.49.37.PM.mov

@balazsorban44
Copy link
Member

We will have to look at your code. If your repository is private, feel free to invite me. Otherwise please create a minimal reproduction.

@joeelmahallawy
Copy link
Author

I just added you to the repository, let me know what else I can do, thanks.

@balazsorban44
Copy link
Member

balazsorban44 commented Jun 13, 2022

I'm unable to compile/start the dev server in the repository because of missing dependencies, some seemingly broken/missing code, and probably the missing backend for the GraphQL API, so I'll try to guess here.

It looks like you are using https://www.npmjs.com/package/next-remove-imports which hasn't been updated in 9 months and might be modifying the Next.js webpack configuration in unforeseen ways. There is no semver guarantee when you are changing the default config.

A regression has been fixed regarding the UI library you are using, see #36675.
Since I cannot run the reproduction, I'll assume the bug has been fixed in #36792 and works on canary. Please give it a try!

Also, there might be still issues with the UI library, I found these:
mantinedev/mantine#1214, mantinedev/mantine#1390

@joeelmahallawy
Copy link
Author

It turned out to be a CSS regression issue. I fixed it by downgrading back to React 17.

@balazsorban44
Copy link
Member

balazsorban44 commented Jun 14, 2022

I fixed it by downgrading back to React 17.

This does not sound like a proper fix though. 🤔

Could you create a minimal/runnable reproduction so I can look into this more?

I just tried our example https://github.com/vercel/next.js/tree/canary/examples/with-mantine and it works correctly using canary, no flash.

@ijjk
Copy link
Member

ijjk commented Jun 16, 2022

Hi, the initial issue appears to be resolved, if you are still experiencing CSS issues with react 18 on the latest canary of Next.js please open a fresh issue so we can investigate that further!

@ijjk ijjk closed this as completed Jun 16, 2022
@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 Jul 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
please add a complete reproduction The issue lacks information for further investigation
Projects
None yet
Development

No branches or pull requests

3 participants