Hi,
Trying to update netlify and nextjs and nodejs dependencies in my monorepo and it looks like the netlify cli is getting a bit confused with the folder structure. It gives an error when starting netlify dev that it "couldn't find a pages directory"
.
things I’ve tried so far:
If I create a pages directory at the root of the monorepo, it doesn’t crash.
If I run next dev
instead of netlify dev
without netlify it’s fine.
Removing cross-env NODE_ENV=development
from netlify dev command does nothing.
Reinstalled all dependencies
apps/web/netlify.toml
file:
[dev]
command = "cross-env NODE_ENV=development next dev"
[build.environment]
NETLIFY_NEXT_PLUGIN_SKIP = "true"
NODE_VERSION = "20"
netlify dev crash log, executed from apps/web
◈ Netlify Dev ◈
◈ Injected netlify.toml file env var: NETLIFY_NEXT_PLUGIN_SKIP
◈ Injected netlify.toml file env var: NODE_VERSION
◈ Ignored general context env var: LANG (defined in process)
◈ Setting up local development server
Cleaned up apps/web/.netlify/edge-functions.
◈ Starting Netlify Dev with Next.js
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
✔ Waiting for framework port 3000. This can be configured using the 'targetPort' property in the netlify.toml
◈ Server now ready on http://localhost:8888
◈ Loaded edge function netlify dev handler
Error: > Couldn't find a `pages` directory. Please create one under the project root
apps/web/package.json
"netlify-cli": "^17.22.1",
"@netlify/functions": "^2.6.0",
"@netlify/plugin-sitemap": "^0.8.1",
"next": "^14.2.0",
"next-transpile-modules": "^10.0.1",