Questions tagged [react-scripts]

Package containing various scripts for running applications created via create-react-app

Package containing various scripts for running applications created via create-react-app

501 questions
6
votes
2 answers

Only the first error is shown when CRA project is built

In the default TypeScript based create-react-app project, only the first TS error is shown when the project is built with react-scripts but all errors are shown when running tsc. The project was initialized with create-react-app foo --typescript and…
Estus Flask
  • 206,104
  • 70
  • 425
  • 565
6
votes
1 answer

How to unit test reduxsauce?

I am using reduxsauce library for redux store, and I want to unit test a single redux store in it. The redux file: import { createReducer, createActions } from 'reduxsauce' import Immutable from 'seamless-immutable' /* ------------- Types and…
Maverick
  • 2,738
  • 24
  • 91
  • 157
6
votes
2 answers

"No tests found" when running jest from command line

In a React project built with create-react-app where the test files resides in the same folder next to the code they need to test, like follows: |- /src/path | |- List.tsx | |- List.test.tsx when trying to run npx jest, or using the global jest,…
Marco Lackovic
  • 6,077
  • 7
  • 55
  • 56
6
votes
1 answer

Prod build of React App allows React Dev Tools and show components in source tab inside Browser

Actually, I'm developing a React App and I'm using React Script 2.0 to build it. The weird thing is after I compiled with the react-scripts build command and serve the app with Nginx I'm still allowed to check the state with React Dev Tools, also if…
6
votes
1 answer

Javascript code gets "Attempted import error:" in react-scripts build when importing from Typescript file

Getting an error with react-scripts V2.1.3. We are just migrated to this from V1.x. This all worked well previous to the react-scripts upgrade. The source file (metadataAccess, doing the export) is typescript and has the following code: export const…
6
votes
0 answers

High vulnerability : Missing Origin Validation in Package webpack-dev-server, Dependency of react-scripts

I already spent one whole day trying to fix this issue. I try to keep the description short. Working on Express-Mongo-React web app(MERN) Everything is working properly in local system. I have referred this tutorial to host my project in AWS…
6
votes
2 answers

setting PORT and HOST manually for facebook/create-react-app production build

i used facebook/create-react-app to create a react application and successfully got production build running on http://localhost:5000. my question is is there any way to change the 5000 PORT in this production build ? according to the Advanced…
Viraj
  • 638
  • 1
  • 8
  • 10
5
votes
1 answer

Uncaught ReferenceError: process is not defined (yes I tried all the solutions internet says should solve this)

I've spent days on this issue. Yes, I upgraded to react-scripts 5, yes, I put "react-error-overlay": "6.0.9" in package.json, yes, I deleted the node-modules + package-lock.json, cleared the cache and did npm install again. The error got WORSE after…
Creature
  • 994
  • 1
  • 12
  • 27
5
votes
2 answers

Module not found: Error: Package path ./react/swiper-react is not exported from package

I upgraded to react-scripts v5, and I'm getting these errors: This is how my imports look based on Swiper documentation: import { Swiper, SwiperSlide } from 'swiper/react/swiper-react'; import 'swiper/swiper-bundle.min.css'; import…
Anthony
  • 931
  • 1
  • 13
  • 30
5
votes
1 answer

Dotenv issues/error with create-react-app react-scripts

I keep getting this error in my react app Compiled with problems: X ERROR in ./ node_modules / dotenv / lib / main.js 1: 11 - 24 Module not found: Error: Can't resolve 'fs' in 'C:…
SMTP King
  • 429
  • 3
  • 12
5
votes
4 answers

Load different JS library files for different components

I have a website made in ReactJS. In public/index.html, I have
where analyzejs-v1.js has 6Mo, and…
SoftTimur
  • 5,630
  • 38
  • 140
  • 292
5
votes
2 answers

Is it possible to disable ESLint when running npm run build for a React app?

I have an app initiated using Create React App, so npm run build runs react-scripts build. I recently installed prettier and so added a .eslintrc.json file to the project root to load the prettier plugin. npm run build works as expected locally,…
Derek
  • 827
  • 11
  • 23
5
votes
0 answers

TypeError: Cannot read property 'name' of null on export default function using react-scripts to compile

I'm facing a compilation issue, that I've managed to work-around somehow, but I'd like to understand where exactly is the problem coming from. Here is the issue: I'm using react-create-app project to bootstrap a React project and I get the…
5
votes
3 answers

react-scripts build "Parse error on line 1"

I have created a React App with "create-react-app" and it runs fine via "npm start" however, when I try to build or deploy to Heroku I get an error from the react-scripts build.js with the log: -----> Build Running build >…
5
votes
2 answers

react-scripts build into a subdirectory

I am using create-react-app and running react-scripts build on a my project, but I'm having an issue with the build output. I need the build output to go in a subdirectory of the build folder like shown here Build -- Player And I need the Urls for…
Danny Ellis Jr.
  • 1,674
  • 2
  • 23
  • 38