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

Runtime.ImportModuleError missing module ./combine.js #122

Open
tim-oe opened this issue Jun 1, 2021 · 3 comments
Open

Runtime.ImportModuleError missing module ./combine.js #122

tim-oe opened this issue Jun 1, 2021 · 3 comments

Comments

@tim-oe
Copy link

tim-oe commented Jun 1, 2021

works fine without plugin (see serverless.yml and package.json below)

get runtime error trying to execute lambda

{"errorType":"Runtime.ImportModuleError","errorMessage":"Error: Cannot find module './combine.js'\nRequire stack:\n- /var/task/_optimize/promo-warm-lead-local-click/src/functions/handler.js

serverless --version
Framework Core: 2.25.2
Plugin: 4.4.3
SDK: 2.3.2
Components: 3.7.0

package.json
package.txt
serverless.yml
serverless.txt

@anees-kodappana
Copy link

anees-kodappana commented Aug 25, 2021

@tim-oe any updates on this, it's something related to the bundling of the Winston plugin, but don't know what exactly issue is

@shesupplypi
Copy link

I am facing the same issue

@juliankha
Copy link

I think the problem is here, I'm not 100% sure:

/*
 * @api private
 * method {function} exposeFormat
 * Exposes a sub-format on the main format object
 * as a lazy-loaded getter.
 */
function exposeFormat(name, path) {
  path = path || name;
  Object.defineProperty(format, name, {
    get() {
      return require(`./${path}.js`);
    },
    configurable: true
  });
}

//
// Setup all transports as lazy-loaded getters.
//
exposeFormat('align');
exposeFormat('errors');
exposeFormat('cli');
exposeFormat('combine');

maybe you can add winston to your external:

optimize:
    external: ['winston']

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

4 participants