netlify serve
modifying incorrect .gitignore
#6958
Labels
type: bug
code to address defects in shipped code
netlify serve
modifying incorrect .gitignore
#6958
Describe the bug
In a pnpm workspace, if a subdirectory is a package acting as a Netlify app, then running
netlify serve
should:.netlify
directory within that subdirectory ✅.netlify
to that subdirectory's.gitignore
if not already present ❌Instead of modifying
<package>/.gitignore
, the root.gitignore
gets modified with:netlify serve
is already figuring out where to write.netlify
to, so it should start there and look for a.gitignore
that contains.netlify
. If none is found, then go ahead and modify the root.gitignore
or add a.gitignore
for that package.Steps to reproduce
git clone remix-run/react-router-templates
git checkout ff303a5bd4c742104c601dc5eda4f825d10739b8
(known commit that has this issue)pnpm install
cd netlify
pnpm build
pnpm start
(you may need to updatenetlify.toml
withpnpm
instead ofnpm run
)netlify serve
and rungit status
Configuration
Environment
System: OS: macOS 15.1.1 CPU: (8) arm64 Apple M1 Pro Memory: 928.36 MB / 16.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 20.11.0 - ~/.nvm/versions/node/v20.11.0/bin/node Yarn: 1.22.22 - ~/.nvm/versions/node/v20.11.0/bin/yarn npm: 10.2.4 - ~/.nvm/versions/node/v20.11.0/bin/npm pnpm: 9.14.4 - ~/.nvm/versions/node/v20.11.0/bin/pnpm npmPackages: netlify-cli: ^17.38.0 => 17.38.0
The text was updated successfully, but these errors were encountered: