Tuesday 15 December 2020

Netlify: Failed to upload file: &{Name:submission-created during build

I'm trying to use netlify and its lambda function feature to run a node function. Based on https://css-tricks.com/using-netlify-forms-and-netlify-functions-to-build-an-email-sign-up-widget/.

I'm having trouble getting node modules to work (see ImportModuleError","errorMessage":"Error: Cannot find module while using Netlify lambda functions with dependencies)

Currently my netlify.toml has only the following:

[build]
  functions = "./functions"
  command = "npm run-script build"

and my package.json:

{
  "name": "test2",
  "version": "1.0.0",
  "description": "",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "build": "npm install && npm build"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/kc1/test2.git"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "bugs": {
    "url": "https://github.com/kc1/test2/issues"
  },
  "homepage": "https://github.com/kc1/test2#readme",
  "dependencies": {
    "dotenv": "^8.2.0",
    "node-fetch": "^2.6.1"
  }
}

You can see the deploy log here: https://app.netlify.com/sites/inspiring-ardinghelli-4a4da5/deploys/5fd180d4db83b400073f8694. What am I doing wrong?



from Netlify: Failed to upload file: &{Name:submission-created during build

No comments:

Post a Comment