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

Propshaft unable to find assets installed via yarn #128

Open
antarr opened this issue Aug 26, 2023 · 2 comments
Open

Propshaft unable to find assets installed via yarn #128

antarr opened this issue Aug 26, 2023 · 2 comments

Comments

@antarr
Copy link

antarr commented Aug 26, 2023

I upgraded my rails from sprockets to propshaft. When compiling assets I'm getting an error saying files cannot be found for anything installed via yarn.

error

 ✗ yarn build:css
Error: Can't find stylesheet to import.
  ╷
1 │ @import "bootstrap/scss/bootstrap";
  │         ^^^^^^^^^^^^^^^^^^^^^^^^^^
  ╵

app/assets/stylesheets/application.bootstrap.scss

@import "bootstrap/scss/bootstrap";
@import "bootstrap-icons/font/bootstrap-icons";

.pnp.cjs

    "packageRegistryData": [\
      [null, [\
        [null, {\
          "packageLocation": "./",\
          "packageDependencies": [\
            ["@ladjs/bootstrap-social", "git+ssh://git@github.com/niftylettuce/bootstrap-social.git#commit=f7d456c7982cdd865a8ac75025a5e68b4c71c925"],\
            ["@popperjs/core", "npm:2.11.8"],\
            ["@rails/actioncable", "npm:7.0.6"],\
            ["@rails/activestorage", "npm:7.0.6"],\
            ["@rails/ujs", "npm:7.0.6"],\
            ["@rails/webpacker", "npm:5.4.4"],\
            ["autoprefixer", "virtual:d95f65753489d049152fe4314b59c02da89739d38f62de0f1c0235045e704bb6949747c4774f8b30e11e5315307fea5ec44dc7b1cc4e6f353c11411f97c7bcff#npm:10.4.15"],\
            ["autosize", "npm:4.0.4"],\
            ["bootstrap", "virtual:d95f65753489d049152fe4314b59c02da89739d38f62de0f1c0235045e704bb6949747c4774f8b30e11e5315307fea5ec44dc7b1cc4e6f353c11411f97c7bcff#npm:5.3.1"],\
            ["bootstrap-icons", "npm:1.10.5"],\
            ["bootstrap-notifications", "npm:1.0.3"],\
            ["bootstrap-notify", "npm:3.1.3"],\
            ["bootstrap-reboot", "npm:4.5.6"],\
@antarr antarr changed the title TypeError after installing bootstrap Propshaft unable to find assets installed via yarn Aug 26, 2023
@RedaBenh
Copy link

i have the same error on a new rails 7 app

@maxveldink
Copy link

maxveldink commented Oct 24, 2023

Ran into this issue today. cssbundling-rails seems to not know about Yarn 4's Plug n Play default node linker. I changed this to the node-modules option and got this to pass. I'll watch this issue to see if there are any updates for supporting the Yarn PNP linker.

Here's the line to add to the .yarnrc.yml file if you're interested in doing the same:

nodeLinker: node-modules

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

3 participants