Open stewarthull7 opened 4 years ago
I've made some progress with this. Everything works fine when the plugin is installed explicitly with npm install serverless-bundle
, but when running npm install
with the plugin already listed in package.json, the issue arises.
Can you try removing your package lock file and try it an install from scratch?
Thanks for your response. I have tried this with no luck. The only workaround seems to be to remove the plugin and install it again. This is annoying, as every time I do an npm install
it breaks again.
That's really weird. Can you create a simple repo with this problem?
I ran into this issue this morning. Any progress or discoveries about it?
I ran into this issue this morning. Any progress or discoveries about it?
The issue is a posix/win32 path problem.
There is no fix from the author yet, so I'm currently using a self-authored patch with patch-package.
Here is my patch: serverless-bundle+5.5.0.patch
diff --git a/node_modules/serverless-bundle/src/webpack.config.js b/node_modules/serverless-bundle/src/webpack.config.js
index f9b1b76..b74ac1b 100644
--- a/node_modules/serverless-bundle/src/webpack.config.js
+++ b/node_modules/serverless-bundle/src/webpack.config.js
@@ -29,7 +29,7 @@ const defaultConfig = importFresh("./config");
const isLocal = slsw.lib.webpack.isLocal;
const aliases = config.options.aliases;
-const servicePath = config.servicePath;
+const servicePath = config.servicePath.replace(/\\/g, "/"); // Fix glob issues by converting the path to posix.
const nodeVersion = config.nodeVersion;
const externals = config.options.externals;
const copyFiles = config.options.copyFiles;
@@ -339,7 +339,7 @@ function plugins() {
return {
to: data.to,
context: servicePath,
- from: path.join(servicePath, data.from),
+ from: path.posix.join(servicePath, data.from), // Fix glob issues by converting the path to posix.
};
}),
})
Note that I'm using version 5.5.0.
We ran into this issue yesterday. Does the above patch break Linux or MacOS? If not I'd be happy to raise a PR to get it merged in.
I have been using serverless-bundle for a while now without any issues. Suddenly, when removing my node_modules folder and running
npm install
, I am now getting an error. Please see my output below when running serverless offline. I get the same error when runningserverless deploy
.Here is my package.json:
Here is my serverless.yml:
I have tried downgrading to v3.0.0. I've tried removing my package-lock.json file. No changes have been made to my config since it was previously working, only the
npm install
, so my thoughts are it must be a dependency package issue of some sort. The issue is only on Windows: Windows 10 Version 1903 (OS Build 18362.1139). Works fine on Ubuntu. Issue can be replicated on my developer's PC too.