[Bug]: publishDir
incorrect when deploying using Netlify CLI with cwd
option
#1258
Closed
2 tasks done
Labels
type: bug
code to address defects in shipped code
Summary
My team has an Nx-managed monorepo. We recently started deploying our web app to Netlify using the CLI. Up till now we've gotten by with having our
netlify.toml
in the root of our repo, but we're trying to colocate that config with the app in order to allow for multiple web apps to be deployed from the monorepo. In pursuit of that, I've been trying to use the lesser-knowncwd
option that the CLI provides.Long-story short, using the cwd option does not work with the Next.js build plugin.
There's two problems. The first appears to be with the Netlify CLI not passing the
cwd
option along, which affected how the publish directory was set. I debugged that and made a patch, see this commit.Fixing that allowed the build and deploy to finish. But then the deploy preview has an error on any page that hits one of the back-end functions about not being able to find required modules. For example, see this link https://622969f742f98859a319f7ab--suspicious-shannon-5bd1ac.netlify.app/fooooooo.
Steps to reproduce
cwd
flag. See here in the reproduction repo for example.This fails:
A link to a reproduction repository
https://github.com/lourd/netlify-cli-repro
Plugin version
4.2.7
More information about your build
netlify.toml
)What OS are you using?
Mac OS
Your netlify.toml file
`netlify.toml`
Your public/_redirects file
`_redirects`
# Paste content of your `_redirects` file here
Your
next.config.js
file`next.config.js`
Builds logs (or link to your logs)
Build logs
Function logs
Function logs
.next JSON files
generated .next JSON files
The text was updated successfully, but these errors were encountered: