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

Node_modules can not be copied #735

Open
owen2345 opened this issue Feb 18, 2022 · 4 comments
Open

Node_modules can not be copied #735

owen2345 opened this issue Feb 18, 2022 · 4 comments

Comments

@owen2345
Copy link

Expected behavior

Having configured the following in app/assets/config/manifest.js

  //= link_tree ../../../node_modules/@fortawesome/fontawesome-free/webfonts/

And precompiled with: rails assets:precompile
The expected fonts (*.ttf files) should be copied to public/assets/

Actual behavior

The expected fonts (*.ttf files) are not copied to public/assets/

System configuration

  • Sprockets version: 4.0.2
  • Ruby version: 3.1.0

Example App (Reproduction) -

  • Add font awesome to the app
    yarn add @fortawesome/fontawesome-free
  • Edit app/assets/config/manifest.js to copy fonts when compiling assets
    //= link_tree ../../../node_modules/@fortawesome/fontawesome-free/webfonts/
  • Compile assets
    rails assets:precompile
@rafaelfranca
Copy link
Member

Is node_modules is your assets paths?

@rafaelfranca
Copy link
Member

Can you provide an example application that reproduce the issue?

@KonnorRogers
Copy link

KonnorRogers commented Jan 11, 2023

FWIW I tried to reproduce this, but couldnt (Although I approached it slightly differently by importing the CSS into the application.js file)

https://github.com/KonnorRogers/fontawesome-free-repro-rails

Relevant file: https://github.com/KonnorRogers/fontawesome-free-repro-rails/blob/65b9b85ddd2b25ff4ddbd6e53d8acd79e5c147d7/app/javascript/application.js#L4-L5

^ Generated via:

rails new -j esbuild
yarn add @fortawesome/fontawesome-free

EDIT: Got this to fail. Never called font-family

@KonnorRogers
Copy link

Update, I got the repo to fail. I never called font-family on a selector. Repo has been updated with failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants