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

CSS Vendors file is empty in production build #4682

Closed
edy opened this issue Jun 26, 2018 · 2 comments
Closed

CSS Vendors file is empty in production build #4682

edy opened this issue Jun 26, 2018 · 2 comments
Milestone

Comments

@edy
Copy link

edy commented Jun 26, 2018

Is this a bug report?

yes

Did you try recovering your dependencies?

yes

Which terms did you search for in User Guide?

Fonts

Environment

$ npx create-react-app --info
npx: installed 67 in 8.4s

Environment:
  OS:  Linux 4.4
  Node:  10.4.1
  Yarn:  0.17.10
  npm:  6.1.0
  Watchman:  Not Found
  Xcode:  N/A
  Android Studio:  Not Found

Packages: (wanted => installed)
  react: ^16.4.1 => 16.4.1
  react-dom: ^16.4.1 => 16.4.1
  react-scripts: ^2.0.0-next.3e165448 => 2.0.0-next.3e165448

Steps to Reproduce

I used react-scripts@2.0.0-next.3e165448 and tried to add a font from npm (typeface-aguafina-script). After building the app and looking at it in the browser, the default browser font is used. In development mode the Font is displayed correctly.

With import 'typeface-aguafina-script'; I imported the font in index.js and set font-family: 'Aguafina Script'; in the body section of my index.css

Development:

  1. git clone https://github.com/edy/cra-font-build-test.git
  2. cd cra-font-build-test
  3. npm start

Production:

  1. git clone https://github.com/edy/cra-font-build-test.git
  2. cd cra-font-build-test
  3. npm run build
  4. npx serve -s build

Expected Behavior

In development mode you can see the font Aguafina Script. I expect that after building the app, i should also see the font.

Actual Behavior

CRA builds the app correctly and copies the fonts into build/static/media. however, the generated file build/static/css/vendors.[hash].chunk.css is empty.

Development:
dev

Production:
prod

Reproducible Demo

  1. git clone https://github.com/edy/cra-font-build-test.git
  2. cd cra-font-build-test
  3. npm run build
  4. npx serve -s build

I included the build folder in my test repository, too.

@bugzpodder
Copy link

bugzpodder commented Jun 30, 2018

EDIT: was able to get a proper repo.

@bugzpodder
Copy link

Should be fixed by #4706

@bugzpodder bugzpodder added this to the 2.0.0 milestone Jul 1, 2018
@Timer Timer closed this as completed in 52449c3 Jul 23, 2018
zmitry pushed a commit to zmitry/create-react-app that referenced this issue Sep 30, 2018
* support scoped packages for cra --scripts-version option

* enable safe option to cssnano processor

Fixes facebook#4682
@lock lock bot locked and limited conversation to collaborators Jan 18, 2019
LishuGupta652 pushed a commit to LishuGupta652/create-react-app-1 that referenced this issue Oct 8, 2024
* support scoped packages for cra --scripts-version option

* enable safe option to cssnano processor

Fixes facebook#4682
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants