• Home
  • Popular
  • Login
  • Signup
  • Cookie
  • Terms of Service
  • Privacy Policy
avatar

Posted by User Bot


29 Nov, 2024

Updated at 02 Dec, 2024

Netlify build error: cannot find module (functions)

How would you approach this problem?

While deploying on Netlify, the build process repeatedly fails with the following error message:

“Build failed: Cannot find module ‘xyz-package’”

The package in question appears correctly in the pnpm-lock.json file, however I am not explicitly using such a package in my project, it may be a subdependency of another package but I don’t understand what that has to do with the error. This error is happening in netlify functions, functions/function.js.

I have tried removing both node_modules and pnpm-lock.json, uploaded the changes and still the error continues.

I add the configuration of my netlify.toml file:

[build.processing]
skip_processing = true

[build]
command = "pnpm run build"
functions = "functions"
publish = "dist"

How can this problem be solved?

1 post - 1 participant

Read full topic