-
Notifications
You must be signed in to change notification settings - Fork 461
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
Strange netlify deployment issues and bugs with monorepo #2411
Labels
Comments
I both have shared dependencies and specific package.json. To my understanding, there are zero problems with the "old" netlify preset. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Environment
Operating System: Linux
Node Version: v18.18.0 // <--- using v20 in prod but this doesn't change the outcomes described
Nuxt Version: 3.11.2
CLI Version: 3.11.1
Nitro Version: 2.9.6
Package Manager: [email protected]
Builder: -
User Config: sourcemap, typescript, experimental, modules, nitro, routeRules, site, sitemap
Runtime Modules: @nuxt/[email protected], @nuxt/[email protected], @nuxtjs/[email protected], [email protected]
Build Modules: -
Reproduction
Cannot repoduce in stackblitz due to wasm env but a repo is available here https://github.com/jbool24/nuxt-netlify-deploy
Describe the bug
There are issues when deploying to Netlfiy with a mono repo.
Intention:
To deploy from a mono repo that is structured with N number of Nuxt3 projects. All projects are top level and there would be a
./layers
dir top level as well to author shared local layers between projects. Currently this is achieved with pnpm workspaces. Any project may iterate over time and "may" have split handling usingrouteRules
. At the current state of this setup only static files are generated for deployment with the intention of adding CMS based dynamic routes over time to the Nuxt app. As its is setup right now this issue has two parts that seem to surface which seem like a bug:Current state:
When using a mono repository setup with Netlify presets (should be zero config) as output for nitro some strange things happen:
{{MONO_REPO_ROOT}}/app_dir/app_dir/.netlify/functions-internal
created within the existing{{MONO_REPO_ROOT}}/app_dir
however nothing is output here. This is also incorrect as it should instead be inside{{MONO_REPO_ROOT}}/app_dir/.netlify
folder that already exists in the nuxt project's root. Even though the end result of the build process outputs a server directory (and assets) in the correct{{MONO_REPO_ROOT}}/app_dir/.netlify/functions-internal/server
directory._redirect
into the dist directory for Netlify use in deployment. When a simple deployment prerenders some pages with route rules and also using the sitemap and the (seo module)[https://nuxt.com/modules/seo] the redirects for sitemap routes instruct netlify with the following:Additional context
Relates to nuxt/nuxt#27026
As Netlify docs instruct for monorepos, a project level
netlify.toml
should specify the base for use during deployment. In theory, Netlify may be able to auto detect a monorepo but there would be a requirement to also build deps from a top level "layers" shared between nuxt projects so we specify abase
dirThe following are relative logs from the Nuxt build process triggered by Netlfiy cli using
ntl serve
to debug/preview a deployment. This is run from the mono-repo root.Tail end of netlify build process and dev server logs (Notice the redirect to non-existing file path. No functions deployed at current state of the Nuxt project with static only routes except
sitemap.xml
sLogs
No response
The text was updated successfully, but these errors were encountered: