Projects with local dependencies should have successful builds every time.
Current Behavior
When using a local stylesheet dependency within the project, the first build succeeds, but subsequent builds fail. This seems to be because in subsequent builds, the cached/layers/paketo-buildpacks_npm-install/build-modules layer is reused and somehow the local dependency is then unable to be found.
Using kpack.
Paketo NPM Install 1.4.10Paketo Node Run Script 1.0.27
Motivations
This prevents our deployments from succeeding. We have to delete our kpackimage object and recreate it every time so the npm-install layer won't be cached and the build will succeed.
Expected Behavior
Projects with local dependencies should have successful builds every time.
Current Behavior
When using a local stylesheet dependency within the project, the first build succeeds, but subsequent builds fail. This seems to be because in subsequent builds, the cached
/layers/paketo-buildpacks_npm-install/build-modules
layer is reused and somehow the local dependency is then unable to be found.Project structure:
package.json
:First build is successful, no layer is cached, and all dependencies are installed screenshot:
Subsequent builds fail. Subsequent builds use the cached
npm-install
layer and fail during theNode Run Script buildpack layer
, screenshot:The specific error is as follows:
Error: Module build failed (from ../layers/paketo-buildpacks_npm-install/build-modules/node_modules/mini-css-extract-plugin/dist/loader.js): HookWebpackError: Module build failed (from ../layers/paketo-buildpacks_npm-install/build-modules/node_modules/sass-loader/dist/cjs.js): SassError: Can't find stylesheet to import.
Possible Solution
Steps to Reproduce
Using
kpack
.Paketo NPM Install 1.4.10
Paketo Node Run Script 1.0.27
Motivations
This prevents our deployments from succeeding. We have to delete our
kpack
image
object and recreate it every time so thenpm-install
layer won't be cached and the build will succeed.