Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"errorMessage": "Error: Cannot find module '/var/task/package.json'", #376

Open
iDcodes opened this issue Sep 6, 2024 · 0 comments
Open

Comments

@iDcodes
Copy link

iDcodes commented Sep 6, 2024

In my serverless.yml

bundle:
    caching: true
    esbuild: true
    linting: false
    minifyOptions:
      keepNames: true 
      minify: false
    externals:
      - backbone
      - batch
      - errlop 

package.json

"dependencies": {
    "@turf/turf": "^3.7.0",
    "bluebird": "^3.4.6",
    "bunyan": "^1.8.1",
    "bunyan-prettystream": "^0.1.3",
    "cheerio": "^1.0.0",
    "docpad": "~6.79.0",
    "docpad-plugin-copy": "~2.1.3",
    "docpad-plugin-handlebars": "~2.3.0",
    "docpad-plugin-ignoreincludes": "~2.1.0",
    "docpad-plugin-less2": "~2.0.4",
    "docpad-plugin-sitemap": "~2.2.0",
    "dotenv": "^16.4.5",
    "emailjs": "^1.0.12",
    "glob": "^10.4.1",
    "got": "^13.0.0",
    "graceful-fs": "^4.1.9",
    "gulp": "^5.0.0",
    "gulp-concat": "^2.6.0",
    "gulp-sourcemaps": "^1.6.0",
    "gulp-uglify-es": "^3.0.0",
    "js-yaml": "^3.7.0",
    "lodash": "^4.16.2",
    "lunr": "^0.7.2",
    "mime-types": "^2.1.12",
    "mkdirp": "^0.5.1",
    "ncp": "^2.0.0",
    "responsive-toolkit": "^2.6.3",
    "rimraf": "^5.0.7",
    "serverless-plugin-write-env-vars": "^1.0.1",
    "stringbuilder": "0.0.11",
    "webpack-stream": "^3.2.0"
  },
"devDependencies": {
    "@aws-sdk/client-s3": "^3.577.0",
    "@aws-sdk/lib-storage": "^3.578.0",
    "serverless-bundle": "^6.3.0"
  }

My application folder structure:

my-app

  • bower_components
  • lib
  • node_modules
  • out
  • src
    -- layout
    -- render
    -- static
  • builder.js
  • handler.js

Where in the handler.js the code inside it is to call the function in builder.js and this builder it will generate the static site using docpad along with other logics needed inside. Now, after I use this serverless-bundle and tried to serverless deploy to generate my lambda package and try to invoke the deployed lambda I encountered this error. I already search online for the possible solution but unfortunately there's nothing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant