Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Issues
  • #1548
Closed
Open
Issue created Feb 13, 2017 by Administrator@rootContributor

Mistake in adding CSS Preprocessor documentation

Created by: KevinBacas

Description

Hello everyone, I am reporting an error in the documentation concerning this section.

In fact, if you follow this tutorial, you modify the "build" script to "build": "react-scripts build && npm run build-css". There is two problems here:

  • You run react-scripts build before processing sass files. So you may not have the latest version of the css file.
  • On a CI server, if you start only from the sources from git, you won't have any .css file created so it returns an error (see below).

Expected behavior

The build script should be: npm run build-css && react-scripts build. So it prevents those issues.

Actual behavior

$ react-scripts build && npm run build-css
Creating an optimized production build...
Failed to compile.

Module not found: Error: Cannot resolve 'file' or 'directory' ./index.css

Environment

Run these commands in the project folder and fill in their results:

  1. npm ls react-scripts (if you haven’t ejected):
my-app@0.1.0 C:\Users\Kevbac\Documents\git\my-app
`-- react-scripts@0.9.0
  1. node -v: v6.9.0
  2. npm -v: 3.10.8

Then, specify:

  1. Operating system: Windows 10
  2. Browser and version:

Reproducible Demo

I just followed the turtorial with a CRA app from scratch.

git clone https://github.com/KevinBacas/my-app
cd my-app
npm install

npm run build # This will throw an error

BTW thank you for documenting this, I'll submit a PR with the little fix attached to this issue.

Assignee
Assign to
Time tracking