dougmoscrop / serverless-plugin-include-dependencies

MIT License
184 stars 38 forks source link

Version 5.0.0 does not include node modules #74

Closed talaikis closed 9 months ago

talaikis commented 3 years ago

Version 5.0.0 stopped including required packages from node_modules.

ericsmallw commented 2 years ago

I had to roll back to v4.1.0

kfirprods commented 2 years ago

I only face this issue on my Windows PC. On a MacBook pro version 5.0.0 works just fine. I also rolled back to 4.1.0

jvanalst commented 2 years ago

I'm also on Windows 10 and v5.0.0 didn't work for me. v4.1.0 worked out of the box.

nunchukgun commented 2 years ago

I tried rolling back to v4.1.0 and it didn't work for me. I'm still missing the pg package (and probably others). Is there some basic configuration I'm not understanding?

poehler commented 2 years ago

I tried rolling back to v4.1.0 and it didn't work for me. I'm still missing the pg package (and probably others). Is there some basic configuration I'm not understanding?

Are you using sequelize? I can't find the link, but I remember having an issue when trying to use pg and sequelize together. To fix it, I had to add an extra "const pgUnecessary = require('pg');" to a file in my project. That forced the packager to add that package. Otherwise it just included the sequelize packages.

neverendingqs commented 2 years ago

Data: I believe our team had success on Windows by switching from package.include and package.exclude to package.patterns. We're running v5.

poehler commented 2 years ago

I'm having this issue with a project (Windows 10). I've used this plugin at work and it is awesome. It adds all the needed dependencies. On this new small project, I had to use the package.patterns to manually add the packages.

At work, my projects seem to add all of them automatically. At work, there is a set of additional serverless tools. Maybe that is what is adding them?

Is it expected to have the packages automatically added to the zip file that is uploaded?

dev101 commented 1 year ago

As pointed in #75 for some reason glob is not included in dependencies, though it's obviously used in the code.

There is a chance you already have glob installed as a dep of some other package, or you may work around #75 by doing npm i --save-dev glob.

In this case it seems to work but on Windows you would miss node_modules as outlined in this issue's topic.

The reason is that you have glob@8 installed, which has a breaking change for Windows by treating \ in paths differently from what glob@7 does. Using glob@8 strips all node_modules paths as because of the way path is constructed, on Windows this path would contain backslash \ ignored by glob@8 .

TL;DR: