Next JS 14 in monorepo deploy error

Hey, I have next folder structure

├── root
│   ├── ...
│   ├── frontend
│   │   ├── app
│   │   ├── node_modules
│   │   ├── ...
│   ├── render.yml

└── 

render.yml

- type: web
  name: app-frontend
  branch: main
  runtime: static
  buildCommand: cd frontend; npm install; npm run build
  startCommand: cd frontend; npm run start
  staticPublishPath: ./frontend/node_modules/.bin/next
  envVars:
  - key: NODE_ENV
    value: production

Error:

found 0 vulnerabilities

May 2 02:12:13 AM

May 2 02:12:13 AM> frontend@0.1.0 build

May 2 02:12:13 AM> next build

May 2 02:12:13 AM

May 2 02:12:14 AM⚠ No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache

May 2 02:12:14 AM ▲ Next.js 14.2.3

May 2 02:12:14 AM

May 2 02:12:14 AM Creating an optimized production build ...

May 2 02:12:59 AMFailed to compile.

May 2 02:12:59 AM

May 2 02:12:59 AMapp/layout.js

May 2 02:12:59 AMAn error occurred in `next/font`.

May 2 02:12:59 AM

May 2 02:12:59 AMError: Cannot find module 'tailwindcss'

May 2 02:12:59 AMRequire stack:

May 2 02:12:59 AM- /opt/render/project/src/frontend/node_modules/next/dist/build/webpack/config/blocks/css/plugins.js

May 2 02:12:59 AM- /opt/render/project/src/frontend/node_modules/next/dist/build/webpack/config/blocks/css/index.js

May 2 02:12:59 AM- /opt/render/project/src/frontend/node_modules/next/dist/build/webpack/config/index.js

May 2 02:12:59 AM- /opt/render/project/src/frontend/node_modules/next/dist/build/webpack-config.js

May 2 02:12:59 AM- /opt/render/project/src/frontend/node_modules/next/dist/build/webpack-build/impl.js

May 2 02:12:59 AM- /opt/render/project/src/frontend/node_modules/next/dist/compiled/jest-worker/processChild.js

May 2 02:12:59 AM at Module._resolveFilename (node:internal/modules/cjs/loader:1143:15)

May 2 02:12:59 AM at /opt/render/project/src/frontend/node_modules/next/dist/server/require-hook.js:55:36

May 2 02:12:59 AM at Function.resolve (node:internal/modules/helpers:190:19)

May 2 02:12:59 AM at loadPlugin (/opt/render/project/src/frontend/node_modules/next/dist/build/webpack/config/blocks/css/plugins.js:49:32)

May 2 02:12:59 AM at /opt/render/project/src/frontend/node_modules/next/dist/build/webpack/config/blocks/css/plugins.js:157:56

Hi there,

Can you share your package.json with us? Just be mindful that when running npm install with NODE_ENV=production you will not install your devDependencies. So please make sure any modules needed to deploy your service are included in your dependencies.

Regards,

Keith
Render Support, UTC+10 :australia: