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

Bundling error with serverless-bundle #351

Open
ryok90 opened this issue Jul 3, 2023 · 1 comment
Open

Bundling error with serverless-bundle #351

ryok90 opened this issue Jul 3, 2023 · 1 comment

Comments

@ryok90
Copy link

ryok90 commented Jul 3, 2023

Hey there!
I stumbled across an error that I am not sure if the problem lies here or on serverless-bundle repository.
The thing is that I am trying to setup up a serverless project with minimum configuration since I lack the deep knowledge to set up a packaging workflow properly.

I have this repository already set up to reproduce the issue.
When trying to package a project using TypeDORM, the bundling returns the following error.

image

After following this error around and also checking out the examples here on how to bundle with webpack, I've managed to fix it with a temporary workaround: changing a rule for a loader directly on the webpack file of the serverless-bundle dependency (I know, not ideal but I am trying to get to the root of the problem).

image

Alright, bundling working with the manual fix but something else broke: the sourcemap.
It now points directly to the TypeDORM package and I really don't know where else to go.

image

One thing that I notice is that the imports from the ESM modules on the dependencies of TypeDORM are not fully specified but as the package type is module, this should be, shouldn't it?

Granted, I know very little about this side of the business and I am just trying to get a better understanding of the problem and even help if possible.

I am very close to dropping everything with serverless-bundle and just try and setup everything from scratch.

Any help or guidance will be greatly appreciated.

@ryok90 ryok90 changed the title Bundling error wiith serverless-bundle Bundling error with serverless-bundle Jul 4, 2023
@blade2005
Copy link

webpack needs '.mjs' as part of the resolve.extensions

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

2 participants