Syntax error – Support for the experimental syntax ‘decorators-legacy’ isn’t currently enabled

I had the same problem, but I was able to get it working by running npm install –save-dev @babel/plugin-proposal-decorators and adding [“@babel/plugin-proposal-decorators”, { “legacy”: true }] to the plugins section in my .babelrc. The plugins section of .babelrc, for me, now looks like this: “plugins”: [ [“@babel/plugin-proposal-decorators”, { “legacy”: true }] ]

Preset files are not allowed to export objects

You’re using a combination of Babel 6 and Babel 7. There is no guarantee of compatibility across versions: “@babel/core”: “^7.0.0-beta.40”, “babel-cli”: “^6.26.0”, “babel-loader”: “^8.0.0-beta.0”, “babel-plugin-lodash”: “^3.3.2”, “babel-plugin-react-transform”: “^3.0.0”, “babel-preset-react”: “^6.24.1”, should be “@babel/core”: “^7.0.0-beta.40”, “@babel/cli”: “^7.0.0-beta.40”, “babel-loader”: “^8.0.0-beta.0”, “babel-plugin-lodash”: “^3.3.2”, “babel-plugin-react-transform”: “^3.0.0”, “@babel/preset-react”: “^7.0.0-beta.40”, and query: { presets: [‘react’, ‘es2015’], plugins: [‘transform-class-properties’] } would be … Read more

What’s the difference between babel-preset-stage-0, babel-preset-stage-1 etc?

Babel’s stage presets equate to the TC39 Process and the different states of each proposal for a potential language change. They include implementations and polyfills for all of the proposed changes in that stage. Anything currently in Stage-0 is Strawman, not ES6. It is future Javascript and absolutely not certain that it will ever make … Read more

Re-export default in ES 6 modules

If you use proposal-export-default-from Babel plugin (which is a part of stage-1 preset), you’ll be able to re-export default using the following code: export default from “./App.js” For more information see the ECMAScript proposal. Another way (without this plugin) is: export { default as App } from “./App.js” The above is a very common practice … Read more

Extending Error in Javascript with ES6 syntax & Babel

Based on Karel BĂ­lek’s answer, I’d make a small change to the constructor: class ExtendableError extends Error { constructor(message) { super(message); this.name = this.constructor.name; if (typeof Error.captureStackTrace === ‘function’) { Error.captureStackTrace(this, this.constructor); } else { this.stack = (new Error(message)).stack; } } } // now I can extend class MyError extends ExtendableError {} var myerror = … Read more

How do I install the babel-polyfill library?

This changed a bit in babel v6. From the docs: The polyfill will emulate a full ES6 environment. This polyfill is automatically loaded when using babel-node. Installation: $ npm install babel-polyfill Usage in Node / Browserify / Webpack: To include the polyfill you need to require it at the top of the entry point to … Read more

Upgrade to Babel 7: Cannot read property ‘bindings’ of null

In your .babelrc file, change { “presets”: [“env”] } to { “presets”: [“@babel/preset-env”] } (and install that package if you haven’t already). In your .babelrc you are still referencing the package babel-preset-env (which is for 6.x), you want to reference @babel/preset-env instead (which is for 7.x). https://github.com/babel/babel/issues/6186#issuecomment-366556833 Note: you should also make this change in … Read more

ES6 getter/setter with arrow function

According to the ES2015 grammar, a property on an object literal can only be one of three things: PropertyDefinition: IdentifierReference PropertyName : AssignmentExpression MethodDefinition The only one of these type that allows a leading get is MethodDefinition: MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody } GeneratorMethod get PropertyName ( ) { FunctionBody } set … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)