Questions tagged [create-react-app]

create-react-app is a starter-kit for creating React apps with no build configuration. If you’re getting started with React, use this to automate the build of your app. There is no configuration file, and react-scripts is the only extra build dependency in your package.json. Your environment will ...

0
votes
0answers
3 views

lint-staged no stage files match

Used create-react-app template. Windows, OpenServer. package.json { "name": "league-finder", "version": "0.1.0", "private": true, "dependencies": { "react": "^16.5.2", "react-dom": "^...
0
votes
0answers
3 views

Oauth2 Social login(Facebook, Google) not work on Feathers API backend server, React frontend.

I've followed the oauth2 implementation tutorial for feathers but it's not working. it says invalid grant on google's response. After clicking my account google's sign in view, it successfully ...
0
votes
0answers
3 views

Display create react app's lint errors in Visual Studio Code with 'react-app'

With create react app and Visual Studio Code, I want display errors in editor. I have followed this tutorial, however getting below error in 'OUTPUT' [Error - 12:41:48 PM] Cannot find module 'eslint-...
1
vote
1answer
15 views

why is jest not required?

I have a react app and I don't know why I don't need to require the jest module. import Task from './Task'; describe('class Task', () => { it('inProgress()', () => { var t = new Task("...
1
vote
2answers
15 views

Can I use Build Environment Variables in Netlify with Create-React-App?

How do I use Build Environment Variables in Netlify with Create-React-App?
1
vote
2answers
25 views

Getting “Error: Plugin/Preset files are not allowed to export objects, only functions.” from babel-preset-react-app/index.js

So I have a project that was bootstrapped with create-react-app and when trying to build with react-scripts build, I receive the following error output: Module build failed: Error: Plugin/Preset ...
0
votes
1answer
17 views

Service worker unexpected behavior with 2 react apps on same domain

I have 2 react apps (bootstrapped with create-react-app) running on the same domain. One app is served on the root (mydomain.com) and the other is served inside a subfolder (mydomain.com/path). The ...
0
votes
0answers
22 views

React: import different files depending on env

I need to import different .js files inside another .js file(based on production or development mode), how can I do that? Here is the example: MyCar.js If "development" import * as cars from '...
0
votes
2answers
30 views

webpack -p not running on create-react-app

I have a big project which I was trying to reduce in size using webpack-p according to here: https://hackernoon.com/reduce-webpack-bundle-size-for-production-880bb6b2c72f I could not run it as I was ...
0
votes
2answers
21 views

Service Worker prevents Nginx to match location

With Nginx I'm serving a CMS application on /admin and a React app with React Router on /. If I check /admin I can see the CMS. But if I go to / (where I see the app) and then I go back to /admin I ...
0
votes
0answers
8 views

build failing in create react if there are lint errors after ejecting

I was able to run "npm start" before ejecting CRA. After I performed "npm run eject" build is getting failed due to lint errors and unable to run localhost. If linting errors are reasons behind build ...
0
votes
0answers
18 views

Production Build doesn't load images

I'm trying to display a profile picture for a profile. The user can replace his profile picture with another one. I do that by deleting the old image and add the new one that's uploaded BUT with the ...
0
votes
0answers
16 views

External css library like font awsome not able to import after react app eject

I createded a react application using https://github.com/facebook/create-react-app. And I eject the app npm run eject and modified webpack.config.dev.js and ****Webpack.config.prod.js ` module: { ...
0
votes
0answers
19 views

React app state getting lost in hot reloading in “Create React App”

I am working with create react app, and react router. Trying to setup hot reloading, with following tutorials 1. https://www.youtube.com/watch?v=f-ctxG2qEps 2. https://medium.com/@brianhan/hot-...
-1
votes
1answer
24 views

Netlify build Error using create-react-app (CRA) website

Getting: Build script returned non-zero exit code: 1 I have deployed my react js website code through Netlify and getting a build log and error as follows: 10:37:15 AM: Build ready to start 10:37:...
0
votes
0answers
21 views

how to replace string in build file

Using react, in a create-react-app app, not ejected. I normally do yarn run build. Now i need to replace a string in the generated file to have instead of A: {e.exports=n.p+"static/media/VideoIO....
0
votes
1answer
66 views

Uninstalling Expo CLI

I have installed Expo CLI globally and cant start a new react native app without using expo cli and therefore would like to uninstall it from my system. I have spent hours trying to work out how to ...
0
votes
0answers
16 views

Using 'fs' in create-react-app for snappy?

I want to use node-snappy in my create-react-app app, in order to help with compression. When importing snappy, I get the following error TypeError: exists is not a function Function.getRoot ...
0
votes
1answer
21 views

How to update default react(CRA) to webpack4 and babel7?

If someone has done it, please help me with updating dependencies and webpack configuration file.
0
votes
0answers
40 views

How to make Custom Offline fallback page with create-react-app?

I want to develop an app that is working on offline page with cache. I'm using workbox and react-app-rewired to generated custom service-workers for Create react app. I'm already successful pre-...
0
votes
1answer
24 views

Why Do We Keep Having to Re-Build Our React App to Test Changes?

New to React, and excited to be getting started with it. Followed the tutorial connected to this project, which uses create-react-app to generate a new react application. For some reason we can't ...
0
votes
0answers
14 views

Setting up Package.json for Heroku deployment of Backend and Frontend Node/React Project

I have a project structured like this: | |-- frontend/ | | ...(create-react-app) | | package.json | |-- backend/ | | ...(node.js & express serving an API) | | package.json | | package....
3
votes
2answers
60 views

Can I change the name of the public folder in create-react-app without ejecting?

I have a create-react-app project that I've set up (express and node connecting to a mysql db on the backend, in case that matters), and it was working just fine. I was told by my project manager that ...
0
votes
0answers
11 views

ReactNative project uses Expo modules

I find out that the latest RN-0.57 is integrated with Expo. So my question is if I use Expo components (such as expo-ar-kit or some expo-xxx-module) in RN project created via create-react-native-app, ...
0
votes
2answers
17 views

Electron-Builder Linux updates - APPIMAGE env is not defined

I am on an Electron + Create React App stack. I am using Electron Updater (https://github.com/develar/electron-updater) for auto updates. Platform: Linux, Format: AppImage. When my app checks for ...
0
votes
0answers
19 views

Lost css features hosting Create-react-app on Heroku

I built a site with create-react-app.This is what i have at the localhost: app running on localhost After following some instructions to host it on heroku, i lost some of the css features.What i ...
0
votes
1answer
44 views

ReactJS/Next.js: CRA Proxy Does Not Work With Next.js (Attempting To Route API Request To Express server)

I'm currently upgrading a vanilla React app to use Next.js (version 7.0.0). The app was originally built with Create-React-App and utilizes the proxy built in to CRA's server. In development my React ...
0
votes
2answers
30 views

Converting project to react native init

Firstly I created my project with create-react-native-app and I'm developing my app with npm start and I have expo installed on my emulator. How can I convert these project into react native init, I ...
2
votes
2answers
25 views

Recomended character line length in React / JSX

I know React community is very focused on creating good patterns, and I've been searching at React forums, github, articles and cannot find any mentions about the 'optimun' line length for jsx code. ...
0
votes
1answer
36 views

Unable to import css in ReactJs application

I'm trying to convert an html template to a ReactJs application. Everything works fine with <link rel="stylesheet" href="%PUBLIC_URL%/css/styles-merged.css"> in the public\index.html file but ...
0
votes
1answer
17 views

How to set up a proxy for Webpack in production

No idea why I can't google this, but I can't seem to figure out how to proxy my api calls in the webpack.config.prod.js file of my create-react-app. Putting it in the package.json file won't do ...
0
votes
1answer
42 views

material-ui and react does not reproduce same behavior after `npm run build`?

I am working on creating a content-library, where I am using react-app using create-react-app. The package.json looks like { "name": "demo", "version": "0.1.0", "private": true, "...
0
votes
1answer
29 views

Fully include Google web font in create-react-app build (without ejecting)

I need to include a Google web font in the build of a React webapp using create-react-app. This is, because the app will be served on a wifi without internet access. The most straightforward solution ...
-2
votes
1answer
26 views

I need run create-react-app with file index.php instead of index.html because i have logic php that i will send to javascript

Execute npm run eject and change extension index.php for index.html, but it does not work. I need include class inside index.php for use function that converter data encrypt and it will be send toward ...
0
votes
0answers
15 views

How to overwrite babel's preset plugin options

I'm using babel-preset-react-app via following .babelrc: { "presets": ["react-app"], "plugins": [ "transform-es2015-modules-commonjs", "transform-async-generator-functions" ] } I need ...
6
votes
1answer
53 views

How to remove dead code in Create React App

I have a create-react-app project, and I am working on reducing my bundled JS file size. About half of my bundle size is coming from a dependency called MDBReact (a react component library), and ...
0
votes
1answer
13 views

Digital Ocean is asking for my Unix password, but once I give it, it closes out

I'm having a lot of trouble launching this app. I finally got it to accept the passphrase for my SSH key, but then it hit me with the following response: >You are required to change your password ...
0
votes
1answer
20 views

pass state as props in component child in React

I get data from a local server, catch them with axios.get, and save them in my state. It's ok, but when i want to pass it as props in an component child, KABOOM! Doesn't work. I'm looking for a ...
0
votes
2answers
37 views

YARN START gives no space left on device error

OS : UBUNTU 18.04 I created a simple create-react-app project then fired up a server using yarn start. 30% of the times it works fine but 70% of the times I get the following error. Starting the ...
1
vote
1answer
25 views

Import multiple similar svg sources in create-react-app efficiently?

I'm going to import a bunch of SVG illustrations into my project as inline SVG components using the new feature of create-react-app @2.0.0. Here is my svg-import.js: import React from 'react'; ...
0
votes
2answers
47 views

'You tried to redirect to the same route you're currently on: “/”' when using a Redirect component with state

I'm trying to create a small demo application with two pages, one and two. The user may navigate from page one to page two by pressing a button, but only if the location objects' state in the second ...
0
votes
1answer
18 views

Having trouble launching app on Digital Ocean

So I'm fairly new to the web dev world, and this will be the first site of mine to go live. I'm using create-react-app with a nodejs backend. I've been trying to figure this out for days and my ...
0
votes
0answers
22 views

Uncaught SyntaxError: Unexpected token < for GET requests in production mode

I have deployed my program in Heroku(Node backend and React for frontend by create-react-app). It's working well for POST requests but for GET requests I'm receiving Uncaught SyntaxError: ...
0
votes
0answers
18 views

reactjs service worker update

I have a PWA made by create-react-app. I have service worker enabled as by default. import registerServiceWorker from './registerServiceWorker' import App from './App' ReactDOM.render( <App />...
1
vote
1answer
16 views

Install NPM modules on current project while offline

this question might seem stupid but I'm looking for a solution to this scenario: Let's say I'm starting a new project at an offline environment and I have some npm packages installed globally on my ...
0
votes
0answers
21 views

Enabling transform class properties in create-react-app

I am using create-react-app for my project and I can't find information on how to enable 'transform-class-properties' plugin, but I don't want to start messing with the core files. Is there a way to ...
0
votes
1answer
18 views

Storybook Cannot Find .ttf, .otf, .png, .svg, .jpg modules from create-react-app

I am working with Storybook and trying to get it to load with typescript, I've followed this tutorial and I started with a create-react-app and ran getstorybook within the project. I am confused as to ...
0
votes
1answer
55 views

First app with create-react-app, npm start not working

I am trying create my first react app and running into issues basically at step 1. I am trying npm start on the default create-react-app install and I am getting the follow error. I have included ...
0
votes
0answers
9 views

Can access sitemap.xml only with “refresh without cash”

So when I'm trying to access sitemap.xml with simply go to abc.com/sitemap.xml it's return my index.html. But when I refresh abc.com/sitemap.xml with "refresh without cash" than browser return ...
0
votes
0answers
22 views

How to add a pre-compile step to an ejected create-react-app?

In a standard ejected create-react-app, when you change a source code file, you'll see: Compiling... Compiled successfully! What I want is a custom command executed before the compilation step each ...