Next/font error, missing lightningcss.linux-x64-gnu.node on deployment

I am currently trying to deploy my project to Vercel but I keep running into this error

src/app/layout.tsx
12:48:04.571 : An error occurred in next/font.
12:48:04.572 : Error: Cannot find module ‘../lightningcss.linux-x64-gnu.node’

[11:57:16.016] Require stack:
[11:57:16.016] - /vercel/path0/node_modules/lightningcss/node/index.js
[11:57:16.016] - /vercel/path0/node_modules/@tailwindcss/node/dist/index.js
[11:57:16.016] - /vercel/path0/node_modules/@tailwindcss/postcss/dist/index.js
[11:57:16.016] - /vercel/path0/node_modules/next/dist/build/webpack/config/blocks/css/plugins.js
[11:57:16.016] - /vercel/path0/node_modules/next/dist/build/webpack/config/blocks/css/index.js
[11:57:16.017] - /vercel/path0/node_modules/next/dist/build/webpack/config/index.js
[11:57:16.017] - /vercel/path0/node_modules/next/dist/build/webpack-config.js
[11:57:16.017] - /vercel/path0/node_modules/next/dist/build/webpack/plugins/next-trace-entrypoints-plugin.js
[11:57:16.017] - /vercel/path0/node_modules/next/dist/build/collect-build-traces.js
[11:57:16.017] - /vercel/path0/node_modules/next/dist/build/index.js
[11:57:16.017] - /vercel/path0/node_modules/next/dist/cli/next-build.js
[11:57:16.017] at Function. (node:internal/modules/cjs/loader:1401:15)
[11:57:16.017] at /vercel/path0/node_modules/next/dist/server/require-hook.js:55:36
[11:57:16.017] at defaultResolveImpl (node:internal/modules/cjs/loader:1057:19)
[11:57:16.017] at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1062:22)
[11:57:16.017] at Function._load (node:internal/modules/cjs/loader:1211:37)
[11:57:16.017] at TracingChannel.traceSync (node:diagnostics_channel:322:14)
[11:57:16.017] at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)
[11:57:16.017] at Module. (node:internal/modules/cjs/loader:1487:12)
[11:57:16.017] at mod.require (/vercel/path0/node_modules/next/dist/server/require-hook.js:65:28)
[11:57:16.017] at require (node:internal/modules/helpers:135:16)

For context, the issue began when I started using next-intl where I had to rearrange my folder structure to use the src folder.
Most solutions online recommend that I delete my package-lock.json file and reinstall the packages but it hasn’t worked for me yet. I’ve also read the next/js documentation and they recommend running their built-in-next-font codemod but it hasn’t helped either. I have even opted to downgrade my next version to 14.2.28 to see if it would help but the issue is still unresolved.

Does it succeed if you redeploy without build cache?

You may also need to adjust the Node.js and Next.js versions used by the project to make sure they’re compatible.

Unfortunately it does not.

I had earlier on thought that the error was because of my Node.js version so I upgraded it to 24.0.2 to run with Next 15.3.0 but the error persisted. It still running on that.

What versions should I use?

I wasn’t able to replicate the error with my test app. Do you have a minimal reproducible example that I can use to dig into this? That way we can debug it together from the same code

I was able to “fix” the error by remaking the project but this time I started with localization, using next-intl folder structure. So I have a hunch that rearranging my folder structure caused the problem. Could this be?

Changing folder organization could definitely have an effect. I’m glad you found a way to make it work!

I am facing the same issue for the past 5 hours , I am in pages router and trying to deploy on vercel.

[22:39:53.058] unhandledRejection Error: Cannot find module ‘../lightningcss.linux-x64-gnu.node’
[22:39:53.059] Require stack:
[22:39:53.060] - /vercel/path0/node_modules/lightningcss/node/index.js
[22:39:53.060] - /vercel/path0/node_modules/@tailwindcss/node/dist/index.js
[22:39:53.060] - /vercel/path0/node_modules/@tailwindcss/postcss/dist/index.js
[22:39:53.060] - /vercel/path0/node_modules/next/dist/build/webpack/config/blocks/css/plugins.js
[22:39:53.060] - /vercel/path0/node_modules/next/dist/build/webpack/config/blocks/css/index.js
[22:39:53.060] - /vercel/path0/node_modules/next/dist/build/webpack/config/index.js
[22:39:53.060] - /vercel/path0/node_modules/next/dist/build/webpack-config.js
[22:39:53.060] - /vercel/path0/node_modules/next/dist/build/webpack/plugins/next-trace-entrypoints-plugin.js
[22:39:53.060] - /vercel/path0/node_modules/next/dist/build/collect-build-traces.js
[22:39:53.060] - /vercel/path0/node_modules/next/dist/build/index.js
[22:39:53.060] - /vercel/path0/node_modules/next/dist/cli/next-build.js
[22:39:53.060] at Function. (node:internal/modules/cjs/loader:1401:15)
[22:39:53.060] at /vercel/path0/node_modules/next/dist/server/require-hook.js:55:36
[22:39:53.060] at defaultResolveImpl (node:internal/modules/cjs/loader:1057:19)
[22:39:53.060] at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1062:22)
[22:39:53.060] at Function._load (node:internal/modules/cjs/loader:1211:37)
[22:39:53.061] at TracingChannel.traceSync (node:diagnostics_channel:322:14)
[22:39:53.061] at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)
[22:39:53.061] at Module. (node:internal/modules/cjs/loader:1487:12)
[22:39:53.061] at mod.require (/vercel/path0/node_modules/next/dist/server/require-hook.js:65:28)
[22:39:53.061] at require (node:internal/modules/helpers:135:16) {
[22:39:53.061] code: ‘MODULE_NOT_FOUND’,
[22:39:53.061] requireStack: [
[22:39:53.061] ‘/vercel/path0/node_modules/lightningcss/node/index.js’,
[22:39:53.061] ‘/vercel/path0/node_modules/@tailwindcss/node/dist/index.js’,
[22:39:53.061] ‘/vercel/path0/node_modules/@tailwindcss/postcss/dist/index.js’,
[22:39:53.061] ‘/vercel/path0/node_modules/next/dist/build/webpack/config/blocks/css/plugins.js’,
[22:39:53.061] ‘/vercel/path0/node_modules/next/dist/build/webpack/config/blocks/css/index.js’,
[22:39:53.061] ‘/vercel/path0/node_modules/next/dist/build/webpack/config/index.js’,
[22:39:53.061] ‘/vercel/path0/node_modules/next/dist/build/webpack-config.js’,
[22:39:53.061] ‘/vercel/path0/node_modules/next/dist/build/webpack/plugins/next-trace-entrypoints-plugin.js’,
[22:39:53.061] ‘/vercel/path0/node_modules/next/dist/build/collect-build-traces.js’,
[22:39:53.061] ‘/vercel/path0/node_modules/next/dist/build/index.js’,
[22:39:53.061] ‘/vercel/path0/node_modules/next/dist/cli/next-build.js’
[22:39:53.061] ]
[22:39:53.062] }
[22:39:53.095] Error: Command “npm run build” exited with 1
[22:39:53.539]
[22:39:56.366] Exiting build container