remix
remix copied to clipboard
Build failed when I use pnpm and I try to deploy on Netlify
What version of Remix are you using?
1.7.3
Steps to Reproduce
- Create a new remix project with npx create-remix@latest (choose Netlify deployment)
- pnpm install (Since last week, Netlify officially supports pnpm)
- pnpm run start works normally
- Deploy the app on Netlify: netlify deploy --build --prod
Expected Behavior
I expect to deploy on Netlify without errors when I use pnpm. Currently, it only works with npm or yarn.
Actual Behavior
I get the following error:
- Functions bundling ────────────────────────────────────────────────────────────────
Packaging Functions from .netlify/functions-internal directory:
- server.js
──────────────────────────────────────────────────────────────── Dependencies installation error ────────────────────────────────────────────────────────────────
Error message A Netlify Function failed to require one of its dependencies. Please make sure it is present in the site's top-level "package.json".
In file "tmp/pnpm-remix-app/.netlify/functions-internal/server.js" Cannot find module 'loose-envify' Require stack:
- /opt/homebrew/Cellar/netlify-cli/12.0.10/libexec/lib/node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/dist/runtimes/node/bundlers/zisi/resolve.js
- /opt/homebrew/Cellar/netlify-cli/12.0.10/libexec/lib/node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/dist/runtimes/node/bundlers/zisi/traverse.js
- /opt/homebrew/Cellar/netlify-cli/12.0.10/libexec/lib/node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/dist/runtimes/node/bundlers/esbuild/src_files.js
- /opt/homebrew/Cellar/netlify-cli/12.0.10/libexec/lib/node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/dist/runtimes/node/bundlers/esbuild/index.js
- /opt/homebrew/Cellar/netlify-cli/12.0.10/libexec/lib/node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/dist/runtimes/node/bundlers/index.js
- /opt/homebrew/Cellar/netlify-cli/12.0.10/libexec/lib/node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/dist/runtimes/node/index.js
- /opt/homebrew/Cellar/netlify-cli/12.0.10/libexec/lib/node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/dist/runtimes/index.js
- /opt/homebrew/Cellar/netlify-cli/12.0.10/libexec/lib/node_modules/netlify-cli/node_modules/@netlify/zip-it-and-ship-it/dist/main.js
- /opt/homebrew/Cellar/netlify-cli/12.0.10/libexec/lib/node_modules/netlify-cli/src/utils/deploy/hash-fns.cjs
- /opt/homebrew/Cellar/netlify-cli/12.0.10/libexec/lib/node_modules/netlify-cli/src/utils/deploy/deploy-site.cjs
- /opt/homebrew/Cellar/netlify-cli/12.0.10/libexec/lib/node_modules/netlify-cli/src/utils/deploy/index.cjs
- /opt/homebrew/Cellar/netlify-cli/12.0.10/libexec/lib/node_modules/netlify-cli/src/utils/index.cjs
I investigated this issue more.
It works if you add a .npmrc file with the following config.
shamefully-hoist=true
I investigated this issue more. It works if you add a .npmrc file with the following config.
shamefully-hoist=trueThis worked, thank you!
What is happening here?