Hey! I have been using vercel for sometime for my nextjs website and it’s great. However, I just found out that they don’t allow commercial sites in the free plan So I had to move to netlify which in my opinion is equally great. My nextjs website uses firebase functions among other things and so I have a created a functions folder in the root directory which is a common thing to do. But when i deploy it on netlify, It throws some erroe because of it. My website deploy fine when I remove or rename the folder. From what I know, I think netlify creates and uses the “functions” directory to store some stuff which doesn’t play well with all the stuff that’s already there. Here’s the Error I am getting:
9:38:10 AM: ──────────────────────────────────────────────────────────────── 9:38:10 AM: Dependencies installation error 9:38:10 AM: ──────────────────────────────────────────────────────────────── 9:38:10 AM: 9:38:10 AM: Error message 9:38:10 AM: A Netlify Function is using "@kubernetes/client-node" but that dependency has not been installed yet. 9:38:10 AM: 9:38:10 AM: By default, dependencies inside a Netlify Function's "package.json" are not automatically installed. There are several ways to fix this problem: 9:38:10 AM: - Removing your Function's "package.json" and adding the dependencies to the project's top-level "package.json" instead. This is the fastest and safest solution. 9:38:10 AM: - Running "npm install" or "yarn" inside your Netlify Function in your build command. 9:38:10 AM: - Adding the following plugin to your "netlify.toml": 9:38:10 AM: 9:38:10 AM: [[plugins]] 9:38:10 AM: package = "@netlify/plugin-functions-install-core" 9:38:10 AM: 9:38:10 AM: In file "/opt/build/repo/functions/index.js" 9:38:10 AM: Cannot find module '@kubernetes/client-node' 9:38:10 AM: Require stack: 9:38:10 AM: - /opt/buildhome/node-deps/node_modules/@netlify/zip-it-and-ship-it/dist/runtimes/node/bundlers/zisi/resolve.js 9:38:10 AM: - /opt/buildhome/node-deps/node_modules/@netlify/zip-it-and-ship-it/dist/runtimes/node/bundlers/zisi/traverse.js 9:38:10 AM: - /opt/buildhome/node-deps/node_modules/@netlify/zip-it-and-ship-it/dist/runtimes/node/bundlers/esbuild/src_files.js 9:38:10 AM: - /opt/buildhome/node-deps/node_modules/@netlify/zip-it-and-ship-it/dist/runtimes/node/bundlers/esbuild/index.js 9:38:10 AM: - /opt/buildhome/node-deps/node_modules/@netlify/zip-it-and-ship-it/dist/runtimes/node/bundlers/index.js 9:38:10 AM: - /opt/buildhome/node-deps/node_modules/@netlify/zip-it-and-ship-it/dist/runtimes/node/index.js 9:38:10 AM: - /opt/buildhome/node-deps/node_modules/@netlify/zip-it-and-ship-it/dist/runtimes/index.js 9:38:10 AM: - /opt/buildhome/node-deps/node_modules/@netlify/zip-it-and-ship-it/dist/main.js Also one thing to note here is that the functions folder contains npm_modules and nodejs functions because firebase function supports nodejs runtime.