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

Subsequent Builds Fail When A Local Dependency Is Used #765

Open
tuckeremulls opened this issue Sep 10, 2024 · 0 comments
Open

Subsequent Builds Fail When A Local Dependency Is Used #765

tuckeremulls opened this issue Sep 10, 2024 · 0 comments

Comments

@tuckeremulls
Copy link

tuckeremulls commented Sep 10, 2024

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:

  • MyAngularProject
    • dependencies
      • @somedepdency
        • prebuilt-themes
          • default.scss
        • shell
    • package.json
    • package-lock.json
    • src

package.json:

{
    ...
    "dependencies": {
        ...
        "@somedependency/prebuilt-themes": "file:./dependencies/@somedependency/prebuilt-themes",
        "@somedependency/shell": "file:./dependencies/@somedependency/shell",
        ...
    }
}

First build is successful, no layer is cached, and all dependencies are installed screenshot:

Screenshot 2024-09-10 155455

Screenshot 2024-09-10 155744

Subsequent builds fail. Subsequent builds use the cached npm-install layer and fail during the Node Run Script buildpack layer, screenshot:

Screenshot 2024-09-10 165154

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 the npm-install layer won't be cached and the build will succeed.

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

1 participant