Skip to content
This repository has been archived by the owner on Nov 6, 2021. It is now read-only.
This repository has been archived by the owner on Nov 6, 2021. It is now read-only.

Using with Serverless Webpack #26

Open
@RishitKedia

Description

Hey there! 👋

This is great! Thank you for writing this plugin. 🙏

Well, I'm not able to get past something when using Serverless Secrets with Serverless Webpack.


I get the following warning from Webpack when bundling my code:
6:16-77 Critical dependency: the request of a dependency is an expression

It's due to the way the .serverless-secrets.json config file is required in this line:

const secrets = require(path.join(process.cwd(), constants.CONFIG_FILE_NAME))


And, I get the following error when I run my function:
Error: Cannot find module "."

It's because this is what my handler.js contains for the previous line after bundling:

const secrets = !(function webpackMissingModule() {
  var e = new Error("Cannot find module \".\"");
  e.code = 'MODULE_NOT_FOUND';
  throw e;
}())

Any thoughts on how this can be fixed? 😰

Thanks for your time! 😃

/cc @HyperBrain [Sorry to bother you, but maybe you can help us with this] 😛

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions