Skip to content
This repository was archived by the owner on Apr 24, 2025. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants