Questions tagged [craco]

Craco stands for Create React App Configuration Overrides - an easy and comprehensible configuration layer for create-react-app.

Craco is a mechanism for overriding aspects the standard Create React App configuration without forcing the developer to eject their app from CRA.

It allows you add a single craco.config.js file at the root of your application and thus customise your eslint, babel, postcss, and webpack configurations.

190 questions
30
votes
6 answers

TypeError: match.loader.options.plugins is not a function

I am trying to use tailwindCSS in a ReactJS app These are the scripts commands in package.json file "scripts": { "start": "craco start", "build": "craco build", "test": "craco test", "eject": "react-scripts eject" } This is my…
0xMukesh
  • 447
  • 1
  • 7
  • 10
16
votes
2 answers

Can't import other project's component in create-react-app with craco

I'm having an issue importing a component from one React project into another. The problems seems very basic but I'm having a really hard time figuring out where the problem is and what is the exact craco configuration to achieve my goal. Exporting…
Mateus Wolkmer
  • 706
  • 4
  • 26
14
votes
10 answers

Craco - Could not resolve dependency error

I am trying to setup TailwindCSS in my Create-React-App project and I am trying to install craco so that I need not eject my CRA When I run the following command npm install @craco/craco, I get unable to resolve dependency tree error. Below is the…
Hendry Lim
  • 1,929
  • 2
  • 21
  • 45
11
votes
0 answers

Craco not supporting react-scripts v. 5 - alternatives?

We're hoping to get our projects using react-scripts v 5, and based on recent comments from the maintainers of craco, a new version with support for the newest version of CRA won't be coming soon (except in the alpha version), if at all. Our…
sailorw-kr
  • 111
  • 4
9
votes
3 answers

Craco does not work properly with react-scripts@5.0.0

After upgrading react-scripts to v5, craco start does not work properly. App starts with no error but in browser, there is a blank page and if i open inspector, i only see index.html codes not react codes. It was working well with…
9
votes
4 answers

React Cannot Start Project - 'craco' is not recognized as an internal or external command

is anyone able to tell me why I cannot start up my website project on the development server? I've cloned a file on Windows 10, this used to work fine on my Mac OS ... before it died :'(Feel free to try the project:…
sudo install
  • 148
  • 1
  • 1
  • 7
8
votes
1 answer

Create React App env variables undefined when using Craco build in Heroku

I'm deploying an Express app (Node.js/React) to Heroku and have set my env vars in Heroku using the config vars in Settings in the Heroku Dashboard. On the server side, I can access them using process.env without any problems. However, in my client,…
vonazt
  • 101
  • 1
  • 5
8
votes
2 answers

Styled Component ReferenceError: Cannot access 'Component' before initialization

While Referencing another component in the styled Component I am getting this error ReferenceError: Cannot access 'SiteHeader' before initialization here is the code //Common.ts import styled from 'styled-components/macro'; import { SiteHeader }…
M Adeel Ahsan
  • 183
  • 1
  • 9
8
votes
1 answer

How to setup alias for Jest with craco

I'm building react app provided by create-react-app. I use craco to make configuration simplify and have set up alise for TypeScript and Webpack. But when I run test command, the following error is displayed. Error Message …
Satoru Kikuchi
  • 1,069
  • 2
  • 21
  • 33
7
votes
0 answers

Adding uncompiled typescript library to Craco config

I have a "common library" written in Typescript and I want to use it in a couple more projects. I don't want to create a npm package from it, I just want to import it as "uncompiled package" but I'm having trouble setting this up. I tried adding…
7
votes
3 answers

Storybook with craco - call a different verson of react-scripts

Storybook currently calls react-scripts. However, I've got some parts of the CRA config overriden with craco. It means my application is invoked with craco ..., rather than react-scripts .... Is there a clean solution to have Storybook call craco…
John Smith
  • 3,863
  • 3
  • 24
  • 42
7
votes
1 answer

How to get require.context to work with Create React App with/withou Craco?

I'm trying to do some requires during runtime through require.context in my CRA (with Typescript) project, but I'm only getting these kinds of errors: TypeError: __webpack_require__(...).context is not a function and Critical dependency: require…
o01
  • 5,191
  • 10
  • 44
  • 85
6
votes
1 answer

Why does my Create React App Dev Server take so long to start?

I have created a web application in React with Create React App. Somewhere in my development process, the launch time for my development server grew tremendously. It now takes about 8 minutes to launch. I am using Craco to modify my Webpack config…
JeremyEastham
  • 177
  • 2
  • 11
6
votes
2 answers

How to start react app on custom port with CRACO?

I want to use Tailwind CSS for my react apps. The problem is CRACO start starts the app on the default port, which is 3000 and I want to have custom ports but I can't figure out what is the right approach. ( Can't find anything about this in their…
DIIMIIM
  • 557
  • 7
  • 28
6
votes
1 answer

How to use ts-nameof with create-react-app or craco?

I want to use ts-nameof in my React app created with create-react-app. How can I do that without ejection? Hint: I also use craco, so a solution involving craco would be also fine for me. Thanks!
stefan.at.kotlin
  • 15,347
  • 38
  • 147
  • 270
1
2 3
12 13