-
Notifications
You must be signed in to change notification settings - Fork 416
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
AWS error: Unable to import module 'src/service/serviceName/handler': Error #383
Comments
Hi @jascination . The "Unable to import module" error means that one of your dependencies is missing in the generated package and AWS cannot load/require the handler. Can you check that you have everything needed in |
There's also an old issue with a discussion thread #230 . I will check if I can get some better error analysis into the plugin, that might be able to find out missing modules while packaging. This would help do fix the configuration for these cases much easier. |
Can you try with |
Ah! That'll almost definitely be the issue, I moved a bunch of things from It's midnight here but I'll try again in the morning, cheers for the tip about the better branch! Really appreciate your thorough answers, thanks for that. Will report back once I've had a look. |
@HyperBrain The |
The 'better-missing-dep-errors' brnach no longer exists. Is there another option for me? I am using "serverless-webpack": "^5.1.5".
|
Use master or the latest version
Christopher Oliphant <notifications@github.com> schrieb am Mi., 27. Juni
2018, 3:44 nachm.:
… The 'better-missing-dep-errors' brnach no longer exists. Is there another
option for me?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#383 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFRM3oaDiQWebJ4aPyXRVdWnK-_w2WXsks5uA4wwgaJpZM4TvDdU>
.
|
Just checked. The fix is available in the current 5.1.5 |
@HyperBrain I can open a new issue, but figured I'd piggy back on this one as I'm running into the same thing. I've checked that everything is good in devDependencies/dependencies and tried
Here's my webpack config (note that I have zero experience with webpack until this, so maybe it's a config error):
Here's my package.json:
and finally my serverless.yml:
I really appreciate any insights you can provide! |
I think I was able to get this working using |
I am importing a module I wrote in the handler. But it's returning the same error mentioned here. Why? And how can I handle it? |
Having the same issue... |
having this same issue, how was anyone able to get it fixed? |
Duplicate of #43 (comment) |
To the future me in another dimension, don't also waste a day trawling Google like i did. Instead follow these very simple steps to track down the missing dependency.
...the clue is to look at the point(s) in the callstack with something with "node_modules", in this case have a look at that file in your project, node_modules/sequelize-typescript/lib/utils/versioning.js, on line 3:
... the culprit is the module "sequelize" in this case... then add this to your serverless.yml:
...republish and try again....profit! (Some of you guys properly think this i very basic, and you are properly right... but i wasted a lot of time tracking this down and i was hoping to spare someone else the hassle...) |
Hi @ThomasEg , |
This is a Bug Report
Description
This vague issue is mentioned in other bug reports, so apologies if it's a duplicate, but while the error code is the same those issues/resolutions seem unrelated to what's happening to me.
When deploying to AWS and trying to access my lambdas, I'm getting:
This is the only error I see (no stacktrace...).
serverless.yml:
My folder structure is like so:
My webpack.config.js:
Additional Data
I get the feeling these errors are because of my folder structure? We've been on an old version of webpack/serverless webpack for the past year and these errors are happening since upgrading from serverless-webpack v2
The text was updated successfully, but these errors were encountered: