create-react-app

PWA2APK on play store is still showing url

时光总嘲笑我的痴心妄想 提交于 2020-04-30 07:01:05
问题 I created a progressive web app, and it works perfectly. It prompts for installation and it saves the link on the android home and it shows no url address bar. Then I used PWA2APK (https://appmaker.xyz/pwa-to-apk/) to create an APK and deploy on play store. Once built, I downloaded the assetlinks.json, added the certificate SHA-256 modifying the assetlinks.json in this way (I changed values): [ { "relation": ["delegate_permission/common.handle_all_urls"], "target": { "namespace": "android_app

Why my environnement variables not picked up with create React app?

白昼怎懂夜的黑 提交于 2020-04-30 06:26:20
问题 I am trying to use environment variables in a react app created on WSL. I cannot access the variables from my app. Here is what I did: Create a .env file at the root folder of my react app (within a client folder of a Rails app) Create a variable: REACT_APP_API_URL=http://localhost:3000/api/v1/ Log the variable in my console: console.log(process.env.REACT_APP_API_URL) Restarted the server I keep getting an undefined variable. Am I missing anything related to WSL maybe? I am a bit clueless as

I can't run a docker container of my reactjs app

老子叫甜甜 提交于 2020-04-30 06:24:50
问题 I'm new with docker and i tried to run a container of create-react-app image so this is the steps that i have done : 1- npx create-react-app frontend 2- I created a Dockerfile.dev like below: FROM node:alpine WORKDIR '/app' COPY package.json . RUN npm install COPY . . CMD ["npm" , "run" , "start"] 3- I used this command to build the image : docker build -f Dockerfile.dev . 4- When i run the container using the image id provided : docker run -p 3000:3000 my_docker_image_id Nothing happens as

npx create-react-app not working “Must use import to load ES Module:”

让人想犯罪 __ 提交于 2020-04-29 12:22:17
问题 I've tried reinstalling node and removing appdata/roaming/npm and npm-cache. I've created several apps before so i'm not sure what's going on. Any help is appreciated. 回答1: this issue is fixed with 2.2.2 version of is-promise package. If you still experience problems creating new CRA, consider npm install -g --force create-react-app If even then bug is still present, please comment your issue to this github issue 回答2: I would: Restart the machine. Ensure you log out of your session if needed

npx create-react-app not working “Must use import to load ES Module:”

和自甴很熟 提交于 2020-04-29 12:14:20
问题 I've tried reinstalling node and removing appdata/roaming/npm and npm-cache. I've created several apps before so i'm not sure what's going on. Any help is appreciated. 回答1: this issue is fixed with 2.2.2 version of is-promise package. If you still experience problems creating new CRA, consider npm install -g --force create-react-app If even then bug is still present, please comment your issue to this github issue 回答2: I would: Restart the machine. Ensure you log out of your session if needed

create-react-app is showing all my code in production, how to hide it?

老子叫甜甜 提交于 2020-04-29 09:22:24
问题 In my chrome sources tab, I am able to view all my files by exact folder location. How can I hide them? These weren't the problem in my previous project, which were made without using create-react-app. 回答1: It seems to be correct behaviour in create-react-app according to Issue #1632. Gaeron: This is expected. You can delete .map files from the build output if you want to disable it, although you'll get console warnings about them missing. There is no harm in leaving them in though in my

create-react-app subfolder projects do not lint

徘徊边缘 提交于 2020-04-13 06:49:13
问题 Projects bootstrapped with create-react-app within subfolders do not lint. However, if I open the project subfolder as root in VSCode (pictured below), or setup a new create-react-app project at root, linting works fine. This occurs with both standard and ejected create-react-app projects. Ideally without ejecting, how can I make create-react-app's linting work with subfolder projects? I'm using create-react-app v3.1.1, VSCode August 2019 and Windows 10. 回答1: The VSCode ESLint Extension

How to enable optional chaining with Create React App and TypeScript

為{幸葍}努か 提交于 2020-04-12 09:59:23
问题 Support for the experimental syntax 'optionalChaining' isn't currently enabled I was getting the above error. I followed this post and added "@babel/plugin-proposal-optional-chaining": "^7.7.4" into my devDependencies . Then I am getting this error, Add @babel/plugin-proposal-optional-chaining (https://git.io/vb4Sk) to the 'plugins' section of your Babel config to enable transformation. So I followed this post and added .babelrc file into my project's root { "presets": ["react", "es2015",

How to enable optional chaining with Create React App and TypeScript

孤人 提交于 2020-04-12 09:58:12
问题 Support for the experimental syntax 'optionalChaining' isn't currently enabled I was getting the above error. I followed this post and added "@babel/plugin-proposal-optional-chaining": "^7.7.4" into my devDependencies . Then I am getting this error, Add @babel/plugin-proposal-optional-chaining (https://git.io/vb4Sk) to the 'plugins' section of your Babel config to enable transformation. So I followed this post and added .babelrc file into my project's root { "presets": ["react", "es2015",

How to config webpack to transpile files from other lerna packages (ejected from create-react-app)

一笑奈何 提交于 2020-04-11 06:26:09
问题 I'm trying to build a lerna package with a create-react-app package and a simple component library. My component is as follows: import React, { Component } from "react"; import PropTypes from "prop-types"; class Layout extends Component { render = () => { let style = { fontSize: 14, fontFamily: "-apple-system, system-ui, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif", fontWeight: 400 };