You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
require() of ES Module /<my_path>/event/index.js from /<my_path>/node_modules/lambda-local/build/cli.js not supported.\nInstead change the require of index.js in /<my_path>/node_modules/lambda-local/build/cli.js to a dynamic import() which is available in all CommonJS modules
Expected behaviour
Use import() for event when --esm flag is provided.
Possible Solution
I have implement a temporary fix on my local, which is hard-coded for ES module. Would like to request on a code change in upcoming release to handle this scenario.
Here's the reference code changes.
// node_modules/lambda-local/build/cli.js// line 135varevent=asyncfunction(){if(program.watch)returnnull;returnawaitimport(utils.getAbsolutePath(eventPath));};
The text was updated successfully, but these errors were encountered:
IamMrandrew
changed the title
Error on importing event on ESM mode
Error on importing event with ESM flag
Apr 26, 2024
IamMrandrew
changed the title
Error on importing event with ESM flag
Error on importing event even with ESM flag
Apr 26, 2024
Context
Just tried to use this package for local lambda development on my project, which is in ES module.
Version:
2.2.0
.Command that I run:
Here's my event file.
Current behaviour
Here's the error that I get.
Expected behaviour
Use import() for event when
--esm
flag is provided.Possible Solution
I have implement a temporary fix on my local, which is hard-coded for ES module. Would like to request on a code change in upcoming release to handle this scenario.
Here's the reference code changes.
The text was updated successfully, but these errors were encountered: