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
Note that app.mjs.handler is wrong. It should be just app.handler.
In my webpack.config.js, I have:
output.library.type set to "module".
output.library.chunkFormat set to "module".
experiments.outputModule set to true.
In my package.json, type is set to "module".
With this, .mjs files are generated instead of .js files. But because the file generated is called app.mjs.js instead of app.mjs, Lambda doesn't load it as an ES Module.
The text was updated successfully, but these errors were encountered:
If I manually go in and rename the app.mjs.js file to app.mjs and then change the template.yml to also point to app.handler instead of app.mjs.handler, it works just fine.
See https://aws.amazon.com/blogs/compute/using-node-js-es-modules-and-top-level-await-in-aws-lambda/
Here is my template file:
When running the plugin, the final template file generated is this:
Note that
app.mjs.handler
is wrong. It should be justapp.handler
.In my
webpack.config.js
, I have:output.library.type
set to"module"
.output.library.chunkFormat
set to"module"
.experiments.outputModule
set totrue
.In my
package.json
,type
is set to"module"
.With this,
.mjs
files are generated instead of.js
files. But because the file generated is calledapp.mjs.js
instead ofapp.mjs
, Lambda doesn't load it as an ES Module.The text was updated successfully, but these errors were encountered: