babeljs

babel-preset-react-app not picking up environment variables

拈花ヽ惹草 提交于 2021-01-22 08:15:23
问题 Failed to compile ./src/index.js Module build failed: Error: Using babel-preset-react-app requires that you specify NODE_ENV or BABEL_ENV environment variables. Valid values are "development", "test", and "production". Instead, received: "undefined". (While processing preset:"C:\Users\mitch\OneDrive\Development\Git\react-seed\node_modules\babel-preset-react-app\index.js") at Array.map (native) I keep getting the above error no matter how many weird and wonderful ways I try to set either the

babel-preset-react-app not picking up environment variables

不问归期 提交于 2021-01-22 08:14:28
问题 Failed to compile ./src/index.js Module build failed: Error: Using babel-preset-react-app requires that you specify NODE_ENV or BABEL_ENV environment variables. Valid values are "development", "test", and "production". Instead, received: "undefined". (While processing preset:"C:\Users\mitch\OneDrive\Development\Git\react-seed\node_modules\babel-preset-react-app\index.js") at Array.map (native) I keep getting the above error no matter how many weird and wonderful ways I try to set either the

Problems with babel loader in react-create-app

泪湿孤枕 提交于 2021-01-21 06:24:44
问题 The Problem create-react-app initializes a repository where babel-loader is installed as an older version than needed. LOG: There might be a problem with the project dependency tree. It is likely not a bug in Create React App, but something you need to fix locally. The react-scripts package provided by Create React App requires a dependency: "babel-loader": "8.0.4" Don't try to install it manually: your package manager does it automatically. However, a different version of babel-loader was

How to create IE11 Bundles with Webpack 5 and Babel 7

余生颓废 提交于 2020-12-23 07:49:24
问题 How can we compile modern JavaScript into backwards-compatible JavaScript bundles that can be used with Internet Explorer 11 (ie11)? Specifically, how can we do this with the latest versions of Webpack 5 and Babel 7? 回答1: Here's the most minimal configuration I could create, with a test file that's included to test with IE 11. Download on GitHub. package.json { "browserslist": [ "ie 11" ], "scripts": { "dev": "webpack -w", "build": "webpack" }, "devDependencies": { "@babel/core": "^7.12.9", "

How to create IE11 Bundles with Webpack 5 and Babel 7

让人想犯罪 __ 提交于 2020-12-23 07:43:17
问题 How can we compile modern JavaScript into backwards-compatible JavaScript bundles that can be used with Internet Explorer 11 (ie11)? Specifically, how can we do this with the latest versions of Webpack 5 and Babel 7? 回答1: Here's the most minimal configuration I could create, with a test file that's included to test with IE 11. Download on GitHub. package.json { "browserslist": [ "ie 11" ], "scripts": { "dev": "webpack -w", "build": "webpack" }, "devDependencies": { "@babel/core": "^7.12.9", "

How to create IE11 Bundles with Webpack 5 and Babel 7

北慕城南 提交于 2020-12-23 07:41:31
问题 How can we compile modern JavaScript into backwards-compatible JavaScript bundles that can be used with Internet Explorer 11 (ie11)? Specifically, how can we do this with the latest versions of Webpack 5 and Babel 7? 回答1: Here's the most minimal configuration I could create, with a test file that's included to test with IE 11. Download on GitHub. package.json { "browserslist": [ "ie 11" ], "scripts": { "dev": "webpack -w", "build": "webpack" }, "devDependencies": { "@babel/core": "^7.12.9", "

Angular Uncaught Error: Template parse errors: is not a known element

青春壹個敷衍的年華 提交于 2020-12-15 05:45:58
问题 I am trying to use babel standalone inside a react app to transpile Angular TypeScript. The transpiling does "work" however I get an error when I try to import a component and use it's selector inside the template of another component. This is the error I get: Uncaught Error: Template parse errors: 'search-bar' is not a known element: 1. If 'search-bar' is an Angular component, then verify that it is part of this module. 2. If 'search-bar' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA'

TypeError: (0 , _schemaUtils.default) is not a function

纵然是瞬间 提交于 2020-12-13 11:37:02
问题 I have a simple React app created with create-react-app that runs fine on localhost. I'm now trying to Dockerify the app. Here's my package.json: { "name": "yeet", "version": "0.1.0", "engines": { "node": "12.x" }, "scripts": { "client": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject", "start": "node server.js", "production": "npm run build && npm run start" }, "private": true, "dependencies": { "@testing-library/jest-dom": "

TypeError: (0 , _schemaUtils.default) is not a function

霸气de小男生 提交于 2020-12-13 11:35:35
问题 I have a simple React app created with create-react-app that runs fine on localhost. I'm now trying to Dockerify the app. Here's my package.json: { "name": "yeet", "version": "0.1.0", "engines": { "node": "12.x" }, "scripts": { "client": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject", "start": "node server.js", "production": "npm run build && npm run start" }, "private": true, "dependencies": { "@testing-library/jest-dom": "

Use Babel to transform jsx only

允我心安 提交于 2020-12-13 04:14:41
问题 I am using Babel with React js. Problem is I don't want to convert es6 to es5. I want to keep using es6. I only need to transform jsx to js. This is my .babelrc { "plugins": ["transform-react-jsx"] } This is my code: import React from "react"; /****** Header *******/ export class Header extends React.Component { onSubmit = (e) => { e.preventDefault(); console.log('Submitting'); const errors = this.validate(); if (Object.keys(errors).length === 0) { this.setState({ loading: true }); fetch(this