babel

Compilation Issue with a React Login Screen

笑着哭i 提交于 2019-12-11 06:28:26
问题 I've been trying to compile the front end of this guide (git repository here) to get my head round JSX and React. I want to eventually use the code to produce a login screen for a Cordova app. When trying to compile with webpack , for which I have the following package.json file setup: { "name": "frontend", "version": "0.1.0", "private": true, "devDependencies": { "babel-core": "^6.25.0", "babel-loader": "^7.1.1", "babel-preset-es2015": "^6.24.1", "html-webpack-plugin": "^2.30.1", "lodash": "

yarn run babel src/ — -d lib/babel — src/ -d lib/ -d doesn't exist. lib/ doesn't exist

£可爱£侵袭症+ 提交于 2019-12-11 06:13:46
问题 I am following steps of https://flow.org/en/docs/install/ When I am running below command then it is giving me an error. yarn run babel src/ -- -d lib/babel -- src/ -d lib/ yarn run babel src/ -- -d lib/babel -- src/ -d lib/ yarn run v0.23.3 $ "D:\ReactJS\todo-app\node_modules\.bin\babel" src/ -d lib/babel -- src/ -d lib/ -d doesn't exist. lib/ doesn't exist error Command failed with exit code 2. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. package.json

async-storage SyntaxError Unexpected identifier while transpiling with Babel7

心已入冬 提交于 2019-12-11 05:03:51
问题 After using @react-native-community/async-storage and transpile it with the following npm command in my react-native environment. "test": "NODE_ENV=test ./node_modules/.bin/mocha --timeout 5000 --require @babel/register \"./src/shared/__tests__/**/*.spec.js\"" I did some research and in no vain. But I found it happens to Jest too. jest test fails after installing react-native-async-storage this is my babel.config.js module.exports = { env: { production: { }, test: { presets: [ '@babel/preset

why browserify build gives error for react build?

自闭症网瘾萝莉.ら 提交于 2019-12-11 05:00:11
问题 i have the following codes , a sample project i done. PlayerWrapper.js import React from 'react' import Player from './Player' class PlayerWrapper extends React.Component { render() { return ( <div> <h3>before player</h3> <Player /> <h3>after player</h3> </div> ) } } export default PlayerWrapper Player.jS import React from 'react' class Player extends React.Component { render(){ return( <div><h1>How are you from Player</h1></div> ) } } export default Player in the package.json i have the

I cannot find setup.py in my OSX babel installation to import the cldr babel files, what am I doing wrong?

柔情痞子 提交于 2019-12-11 04:27:33
问题 I have been trying to use babel on my iMac (OSX Mavericks, I installed python and babel using MacPorts) but I get this error message : [...] writing PO template file to ./locale/messages.pot Traceback (most recent call last): File "/usr/local/bin/pybabel", line 8, in <module> load_entry_point('Babel==2.0-dev-20131218', 'console_scripts', 'pybabel')() File "/Library/Python/2.7/site-packages/Babel-2.0_dev_20131218-py2.7.egg/babel/messages/frontend.py", line 1151, in main return

Module parse failed

依然范特西╮ 提交于 2019-12-11 04:25:28
问题 I'm going to port GiftedMessanger on web. I'm stuck on an error in Webpack bundle: Krishti:react-native-web-exploding-hearts-master MacBook$ npm run web-bundle > react-native-web-exploding-hearts@0.0.1 web-bundle /Users/MacBook/WebWork/ReactWeb/react-native-web-exploding-hearts-master > NODE_ENV=production webpack --config web/webpack.config.js --colors Crawl: 6012ms Hash: d8df1262d7af54a6c6cd Version: webpack 1.12.10 Time: 10949ms [0] multi main 28 bytes {0} [built] + 339 hidden modules

How to provide `babel-preset-react-app` env variables?

不羁的心 提交于 2019-12-11 02:46:37
问题 I am working on an App which connects create-react-app with an express server( using server rendering). I am referring this tutorial for it.To render the file from server, the code is bootstrap.js require('ignore-styles'); require('babel-register')({ ignore:[/(node-modules)/], presets:['es2015','react-app'] }); require('./index'); index.js import express from 'express'; // we'll talk about this in a minute: import serverRenderer from './middleware/renderer'; const PORT = 3000; const path =

How to configure babel correctly to use lodash-es?

左心房为你撑大大i 提交于 2019-12-11 02:21:44
问题 I need to use lodash-es in my project, but I can't configure my babel correctly, it always reports errors like SyntaxError: Unexpected identifier hello.js import upperCase from 'lodash-es/upperCase' console.log(upperCase('lodash-es')); package.json { "scripts": { "demo": "babel-node hello" }, "devDependencies": { "@babel/cli": "^7.0.0", "@babel/core": "^7.0.0", "@babel/node": "^7.0.0", "@babel/preset-env": "^7.0.0" }, "dependencies": { "lodash-es": "4.17.11" } } .babelrc { "presets": [ "

Parsing error: Unexpected token const

ⅰ亾dé卋堺 提交于 2019-12-10 21:33:13
问题 I am currently setting up a meteor application and I am using eslint and babel, but I get the following error for the following code snippet: const Navigation = props => ( const classes = props.classes; return ( <div className={classes.root}> </div> ) ); Error: 2:4 - Parsing error: Unexpected token const I have recreated my eslint config here. My .babelrc config is the following: { "presets": ["env", "react"] } 回答1: It's because you are using the concise body of an arrow function and that

mocha --compilers js:babel/register “cannot find module”

你。 提交于 2019-12-10 20:09:53
问题 Both of these links have tutorials on using mocha with babel compiler and both don't work, and likely haven't worked since 2015: http://redux.js.org/docs/recipes/WritingTests.html https://onsen.io/blog/mocha-chaijs-unit-test-coverage-es6/ mocha --compilers js:babel/register 回答1: Because it took a deep google search to find the solution. I'm making this SO QA. It's now babel-core/register. mocha --compilers js:babel-core/register The answer can be found here https://phabricator.babeljs.io