Category "babeljs"

Module parse failed? I need help setting up Babel

I'm writing my first JavaScript library and I'm testing it locally with a React project. I'm not seeing any Typescript errors when I'm writing my code but when

React Native TypeError: undefined is not an object (evaluating 'props.getItem')

When navigating to certain screens on my React Native app (using expo), I am getting the following error: TypeError: undefined is not an object (evaluating 'pro

How to Enable Private Method Syntax Proposal in React App?

I got "Class private methods are not enabled." error when running npm start on a project using leading # to indicate private methods. I followed this answer: ht

Passing "global" and "ignore" options to browserify via the command line

I'm using browserify with babelify to transpile a JS file. The JS file require()s a component in node_modules, which I also want transpiled. As per the FAQ on

Parsing error : Cannot find module 'next/babel'

I have been encountering this error on every single new Next.js project that I create. The page can be compiled without any problem, it just keeps on showing as

Code inside DOMContentLoaded event not working

I have used <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> </head> <body> <button type="button" id="button"&

How to prevent babel from transpiling generator functions

I have kind of a weird problem with babel. When I use a simple generator function in one of my classes, babel creates a function out of it containing a call to

Babel throwing Support for the experimental syntax 'jsx' isn't currently enabled

I started newly writing unit test cases using Jest and Enzyme for the react application and when try to run test cases using jest like "test": "jest --watch" ra

Remove some code lines in production distribution files?

I'm using Babel and Webpack to generate ES5 code from ES6. There are some validations that is used to reduce the mistakes i do while coding. class Logger {

babel-node is not recognized as an internal or external command, operable program or batch file

When I try to run a JS file by babel command it is showing: "babel-node is not recognized as an internal or external command, operable program or batch file

Anyone has experience using NightWatch with TypeScript?

I am using NightWatch for my e2e testing and want to move towards ES6 way of writing tests. I was able to do it with Babel and it worked fine but I want to use

Re-export default in ES 6 modules

In ES6, is it possible to shorten the following code. I have an App.js file and an index.js. index.js import App from './App'; export default App; Somethin

Unexpected token (16:22) You may need an appropriate loader to handle this file type

I get this error when I start my react project with npm start. Doesnt let me move forward at all. ERROR in ./node_modules/react-csv/src/components/Download.js

how to import css file in react when generating static html and inject imported css into html head tag?

I am trying to generate static html from react using renderToStaticMarkup method. The problem I am facing right now is that I am not able to import css into rea

What is @babel/plugin-transform-classes?

I run Google PageSpeed Insights on my site, and it reports an issue that is "Avoid serving legacy JavaScript to modern browsers", as below: I have no idea of w