create-react-app

Why does the browser try to get files through https when the host is 0.0.0.0?

若如初见. 提交于 2021-01-29 04:12:40
问题 I have an app created by create-react-app . After building, it generates a html file with some JS and CSS files. The html file looks like <!doctype html>...<script src="/static/js/main.89f33fbb.chunk.js"></script></body></html> I try to host those static files by an Express.js server. const app = express() .use(bodyParser.json()) .use(express.static(path.join(__dirname, '../dist'))) app.listen(5000, '0.0.0.0'); When I try to open http://127.0.0.1:5000 or http://localhost:5000 in browser, it

Why does the browser try to get files through https when the host is 0.0.0.0?

谁说胖子不能爱 提交于 2021-01-29 04:05:53
问题 I have an app created by create-react-app . After building, it generates a html file with some JS and CSS files. The html file looks like <!doctype html>...<script src="/static/js/main.89f33fbb.chunk.js"></script></body></html> I try to host those static files by an Express.js server. const app = express() .use(bodyParser.json()) .use(express.static(path.join(__dirname, '../dist'))) app.listen(5000, '0.0.0.0'); When I try to open http://127.0.0.1:5000 or http://localhost:5000 in browser, it

Cannot get react-i18next to read JSON files via FETCH backend

这一生的挚爱 提交于 2021-01-29 03:42:55
问题 I'm trying to use react-i18next on the client using the i18next-fetch-backend , and even though I can get to the JSON translation files via a browser, something is screwy with how they're being handled during the init routine. For the record, I'm using create-react-app as the basis of my front-end React application, if that makes a difference, and so far all of my testing is in localhost (with the React app on localhost:3000, and the "server" on localhost:8000). Here's my init file: import

Create-React-App Unexpected Connection Refused

梦想的初衷 提交于 2021-01-28 14:21:12
问题 I keep getting the below error when I try to simply create a new react app. I even set up fiddler on my computer and set my proxy to work with that but I am still getting the following error: ECONNREFUSED 13.107.6.183:443 Click here for the complete log $ create-react-app testmeup Creating a new React app in C:\***\source\Dev\testmeup. Installing packages. This might take a couple of minutes. Installing react, react-dom, and react-scripts... yarn add v1.15.2 [1/4] Resolving packages... error

Create-React-App Unexpected Connection Refused

感情迁移 提交于 2021-01-28 14:15:58
问题 I keep getting the below error when I try to simply create a new react app. I even set up fiddler on my computer and set my proxy to work with that but I am still getting the following error: ECONNREFUSED 13.107.6.183:443 Click here for the complete log $ create-react-app testmeup Creating a new React app in C:\***\source\Dev\testmeup. Installing packages. This might take a couple of minutes. Installing react, react-dom, and react-scripts... yarn add v1.15.2 [1/4] Resolving packages... error

How can I get rid of the `Node “13.0.0-nightly20190802452b393c1f”` so that I can be able to create a react app using the `create-react-app` tool?

谁说我不能喝 提交于 2021-01-28 07:13:06
问题 I'm trying to create a react app using npx's create-react-app command in ubuntu 18.04 terminal. I have Node v12.8.0 installed. When I run the command npx create-react-app . in the directory of my app, I expect the react app boilerplate folders and files to be generated since I have the latest version of Node v12.8.0 and npm v6.10.2 in my machine.Instead, I get the below output... npx: installed 91 in 5.725s Creating a new React app in /home/<my-PC>/Documents/todo-app. warning You are using

Keep track of progress while precaching assets with the Workbox

泪湿孤枕 提交于 2021-01-28 03:12:39
问题 Imagine we have N assets that need to be pre-cached with a service-worker once user navigated to the web site. We have appropriate precache-manifest.js with listed N-files and we are using workbox.precaching.precacheAndRoute([...]) to configure needed behavior (default CRA setup) Is there a way to keep track of precaching progress when using workbox.precaching.precacheAndRoute or workbox.precaching.precache? I imagine it could be something like passing a parameter-callback function to the

I'm using create-react-app and I need to open build/index.html in browser directly without a server

混江龙づ霸主 提交于 2021-01-28 02:37:49
问题 I'm struggling to find the solution to this issue. I'm using create-react-app and after running npm build I want to be able to open index.html in browser with 'doubleclick' from file location, without the need of npm or any server. I also want my routes and functionality of the app to work in this scenario. I've been doing some research on the matter but couldn't find much. I would like to know if it's possible and if anyone has any links or even solutions to share in case I'm missing

Create React App doesn't strip Flow types inside node_modules directory

两盒软妹~` 提交于 2021-01-28 02:35:22
问题 I've created new React app using create-react-app@1.4.3 . And my app depends on NPM module which contains several Flow typed JSX files (retail-ui). App.js of my React app: import React, { Component } from 'react'; import Button from "retail-ui/components/Button"; import './App.css'; export default class App extends Component { render() { return ( <div> <Button>First button</Button> <Button>Second button</Button> </div> ); } } Head of retail-ui/components/Button: // @flow import events from

React router base code-splitting (get first chunk and then get other chunks async in background)

不羁的心 提交于 2021-01-27 19:56:08
问题 I am using create-react-app. I want to react-router base code-splitting but I want to get the first chunk which user open in browser and then get other chunks asynchronously in the background Routes const HomeModule = React.lazy(() => import('./modules/ft_home_module/src/main')); const AuthModule = React.lazy(() => import('./modules/ft_auth_module/src/main')); const ProfileModule = React.lazy(() => import('./modules/ft_profile_module/src/main')); const MerchantModule = React.lazy(() => import