How to configure atom-beautify package to format with babel/jsx javascript files?

I searched for a package to auto-indent and beautify my React/babel code. I just tried atom-beautify which seems to have good feeback on Atom. But the result on an usual babel file is not good enough: “HTML tag” doesn’t indent as wanted. Has anyone tried to use atom-beautify with babel? Answer I currently use the … Read more

Extended Errors do not have message or stack trace

When running this snippet through BabelJS: class FooError extends Error { constructor(message) { super(message); } } let error = new FooError(‘foo’); console.log(error, error.message, error.stack); it outputs {} which is not what I expect. Running error = new Error(‘foo’); console.log(error, error.message, error.stack); produces {} foo Error: foo at eval (eval at <anonymous> (, <anonymous>:24:9) at REPL.evaluate … Read more

Plugin 0 specified in babel-preset-es2015 provided an invalid property of _c

Getting above error with below configuration, commenting passPerPreset removes the error however. Is there any configuration missing ? .babelrc : { “passPerPreset”: true, “presets”: [{ “plugins”: [ “./build/babelRelayPlugin”, “transform-runtime”, “transform-es2015-classes” ] }, “es2015”, “stage-0”, “react”], “env”: { “development”: { “presets”: [“react-hmre”] } } } package.json : “babel-cli”: “^6.5.1”, “babel-core”: “^6.5.2”, “babel-eslint”: “^4.1.8”, “babel-loader”: “^6.2.2”, “babel-plugin-react-transform”: … Read more

How to use babel/corejs3/webpack correctly for IE11?

With my current config (see below), I’m getting this error: [object Error]{description: “Argument ob…”, message: “Argument ob…”, name: “TypeError”, number: -2147418113, stack: “TypeError: …”, Symbol()_7.bs7gi3oa3wi: undefined} I tried to dig based on Symbol()_ … : undefined} but I couldn’t find any clear indication. This is my .babel.config.js: module.exports = function (api) { api.cache(true); const presets … Read more

Whats the difference when configuring webpack babel-loader vs configuring it within package.json?

Hi please help me understand the differences between setting babel config inside .babelrc vs webpack loader options, vs inserting it in package.json. For example, Would it make any difference if I put the presets in the webpack babel-loader options vs package.json or a separate .babelrc config file? In webpack config: { test: /\.(js|jsx|mjs)$/, loader: require.resolve(‘babel-loader’), … Read more

babel-node vs babel-register in development

Is there any difference between using babel-register or babel-node when running my code in development? The two options are: require(‘babel-register’)({ “presets”: [“es2015”] }); at entry-point.js and npm start script node entry-point.js simply have npm start script babel-node entry-point.js –preset=es2015 Do they do the exact same thing? And is one way recommended over the other? Answer … Read more

Error with gulp serve: Requiring external module babel-register

Running yeoman generator “Webapp”, I’m getting an error when running gulp serve. Here are the following versions for a better background : sw_vers && node -e ‘console.log(process.platform, process.versions)’ ProductName: Mac OS X ProductVersion: 10.11.3 BuildVersion: 15D21 darwin { http_parser: ‘2.6.0’, node: ‘5.2.0’, v8: ‘’, uv: ‘1.7.5’, zlib: ‘1.2.8’, ares: ‘1.10.1-DEV’, icu: ‘56.1’, modules: ’47’, openssl: … Read more

React Native starter project bundling fails with Unexpected Token error

I’m trying to create my first React Native app for Android using the instructions on After setting up the dependencies and connecting my Android device, I ran react-native init app cd app react-native run-android This starts the React Packager, which fails to bundle with this error: error: bundling failed: “TransformError: /Users/luky/dev/app/ Unexpected token ) … Read more

Why can’t I use Array.forEach on a collection of Javascript elements? [duplicate]

This question already has answers here: How to loop through all the elements returned from getElementsByTagName [duplicate] (10 answers) Closed 5 years ago. I’m building an app with Babel/ES6. I want to disable all form elements for a view-only version of it, so I did this: let form = document.getElementById(‘application-form’) let elements = form.elements I … Read more