Build issue with a NextJS Project around @parcel/watcher
toddcornett
PROOP

2 months ago

I am trying to build and deploy a straight NextJS app and I am getting the following build error:

"Error: No prebuild or local build of @parcel/watcher found. Tried @parcel/watcher-linux-x64-glibc. Please ensure it is installed (don't use --no-optional when installing with npm). Otherwise it is possible we don't support your platform yet. If this is the case, please report an issue to https://github.com/parcel-bundler/watcher."

Not sure the issue as I have followed the issue's guidance as well as gone a couple of rounds with the Agent. Honestly not sure what the issue is because I cant reproduce locally. Appears to be a build environment issue.

$10 Bounty

4 Replies

Status changed to Open Railway 2 months ago


goodie323
FREE

2 months ago

Run npm install --save-optional @parcel/watcher-linux-x64-glibc and add a .npmrc file to your project root containing optional=true — Railway's build environment strips optional dependencies by default, which is what @parcel/watcher needs.


toddcornett
PROOP

2 months ago

I tried this (with the exception of "include=optional" in place of "optional=true") and now have a new error in the deployment:

```

npm run build npm warn config production Use --omit=dev instead. > mentha-frontend@0.1.0 build > next build ⨯ Failed to load next.config.mjs, see more info here https://nextjs.org/docs/messages/next-config-error > Build error occurred Error: Failed to load native binding at ignore-listed frames { [cause]: [ Error: Cannot find module './swc.linux-x64-gnu.node' Require stack: - /app/node_modules/next-intl/node_modules/@swc/core/binding.js - /app/node_modules/next-intl/node_modules/@swc/core/index.js at ignore-listed frames { code: 'MODULE_NOT_FOUND', requireStack: [Array] }, Error: Cannot find module '@swc/core-linux-x64-gnu' Require stack: - /app/node_modules/next-intl/node_modules/@swc/core/binding.js - /app/node_modules/next-intl/node_modules/@swc/core/index.js at ignore-listed frames { code: 'MODULE_NOT_FOUND', requireStack: [Array] } ] }

```

[Also attached a screenshot because the error formatting was stripped]

This appears to be a problem with the SWC dependency on linux. Could it be related to the recent NextJS upgrade to 16.2.1?

EDIT: Should also include the fact that the 'npm run build' command works locally.

Attachments


domehane
FREE

2 months ago

Hello toddcornett ,

try deleting your package-lock.json and node_modules locally, run npm install fresh, commit the new lockfile and redeploy. your lockfile was probably generated on a different platform and doesn't include the linux binary for @swc/core-linux-x64-gnu, so railway can't find it at build time. regenerating it forces npm to include all platform variants.

Hope this help you :)


domehane

Hello **toddcornett ,** try deleting your package-lock.json and node\_modules locally, run npm install fresh, commit the new lockfile and redeploy. your lockfile was probably generated on a different platform and doesn't include the linux binary for @swc/core-linux-x64-gnu, so railway can't find it at build time. regenerating it forces npm to include all platform variants. Hope this help you :)

toddcornett
PROOP

2 months ago

Thank you for the reminder! I could have sworn I did both steps already but maybe not at the same time and possibly in combination with other debugging.


Welcome!

Sign in to your Railway account to join the conversation.

Loading...