This repository was archived by the owner on May 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
This repository was archived by the owner on May 17, 2021. It is now read-only.
Module not found #1
Copy link
Copy link
Open
Description
I followed this to the T, I have a feeling serverless-webpack is messing it up. When i look in the transpiled code I see that the module is not found const test = webpack_require(!(function webpackMissingModule() { var e = new Error("Cannot find module 'test'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()));
import { success, failure } from "./libs/response-lib";
export const hello = async (event, context) => {
const fs = require('fs').promises;
try {
const test = require('test');
test();
return success({ status: 'ok' })
}
catch(error) {
console.log(error)
return failure({ message: error.message })
}
};
# NOTE: update this with your service name
service: api
# Create an optimized package for our functions
package:
individually: true
exclude:
- schema-layer/**
plugins:
- serverless-bundle # Package our functions with Webpack
- serverless-offline
- serverless-dotenv-plugin # Load .env as environment variables
provider:
name: aws
runtime: nodejs10.x
stage: dev
region: us-east-1
# To load environment variables externally
# rename env.example to .env and uncomment
# the following line. Also, make sure to not
# commit your .env.
#
#environment:
# sampleEnvVar: ${env:SAMPLE_ENV_VAR}
functions:
hello:
handler: handler.hello
events:
- http:
path: hello
method: get
layers:
- { Ref: SchemalayerLambdaLayer }
layers:
schemalayer:
path: schema-layer
custom:
bundle:
linting: false # disable linting as a part of the build process
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels

