Babeljs Questions
Ad
Cannot find module 'babel-plugin-transform-decorators-legacy'
After npm run eject (this was needed in order to change the webpack.config), i've run into the following problem during the app
Babel not transpile files from parent dir
How can i tell babel to transpile files that are not in current (root) directory? here is my project structure: |-project
Styled component cause error in creating react component library
I'm trying to publish my react component library. but i got an error when i installed my library and tested it in create-react-app. i
Where should I store data, which should not cause rerender React
I'm developing a react.js app. i nearly understand which peace of data should be stored in component state, but how do i handle some of these:
Not able to import bootstrap with reactjs with babel
I am not able to import bootstrap with reactjs using babel with the following code. i used the following cdn to achieve the results.
Run custom function as part of build process with babel
I want to sort a json file as part of my build process. basically i have react-intl which defines localised messages, then
How to config webpack to transpile files from other lerna packages (ejected from create-react-app)
I'm trying to build a lerna package with a create-react-app package and a simple component library. my component is as follows:
Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@babel/plugin-preset-react' imported from
When i run the command to build the react project: yarn build show error: ➜ react-admin
Convert Node.js files to ES5
I have node.js script files which i am trying to re-use inside an asp.net application on ie 11. i follow below steps to use them on ie
updated Ava configuration using babel
We have recently updated from ava 0.17.0 to version 2.4.0. the old configuration in the package.json no longer works and ava tests now fail.
Ad
Get the radio button value every time it changes in ReactJS
I am trying to get the value of the radio button every time i change the active radio button in reactjs, but the code is capturing the first
Initial production build creates bundle code, but all subsequent builds reuse old bundle
After adding authentication with passport and redux to my project, anytime i push my production ready code to my server it reuses an old build of
Cant find what causes the error when import component class
Im getting an error : unexpected token when importing a component-class while within another component class. im new to react, webpack and still
assigning a static class attribute triggers error on babel
I am trying to compile a js class file with babel. the class has static attributes which i initialize on the same line. when compiling i get the
Reactjs - Uncaught SyntaxError: Unexpected token <
I create the reactjs app, test and compile it with webpack, it is fully functional and every thing is okay, once i need to make a production build
React Native 0.60.3 babel-plugin-transform-remove-console not working
I am trying to remove console.log outputs from my react-native application's output, but when i run
Jest encountered an unexpected token (React, Typescript, Babel, Jest & Webpack setup)
I've setup a project using react, typescript, babel, webpack, with prettier & eslint. i set the project up from scratch and had everything
Display data from a local JSON file
I'm learning to code in react from tyler mcginnis' react course
JSX loop not rendering
I think i'm misunderstanding jsx. i've this piece of code: const dgtportal = ({children}) => { console.log(children);
Webpack mixing up default and named imports
While updating some deps (react-bootstrap) i ran into a react error you likely forgot to export your component from
Webpack 4 doesn't throw compilation error on use of undefined functions
I recently got involved in a project which uses webpack bundler. while refactoring the code i noticed that the bundler doesn't throw error on use
Ad
Why does s3.putObject throw ERR_INVALID_ARG_TYPE for nodejs Buffer?
I am writing a lambda function in nodejs for uploading an image to an s3 bucket. in my first lambda function i have written this inline
Babel preset-env not loading top-level await syntax for node target
I am trying out the new top-level await syntax to import a module, but babel is not recognizing the syntax, despite using preset-env, unless i
AWS: Steps to pass a node.js application to EC2
I'm newbie with aws and i'm developing a web application with node.js and react.js. my application works fine in my laptop but i want to upload it
How to transpile node_modules folder using just babel 7?
Trying to unit test reactjs application using mocha but getting error from es6 features (import/export) used inside node_modules
Cannot read property 'name' of undefined : redux-reactstrap-modal
I'm using redux-reactstrap-modal for my project. when i configure
VueJS error on IE11 - SCRIPT1004: Expected ';'
Ie11 - error: script1004: expected ';' hi! my website works on every browser except ie. my babel.config.js file:
How to create your own babel processor alternative to `React`
When you use jsx in a js file, you have to import react or else the generated code won't compile. this is because this:
How to Add React Js On an Existing Website?
So reactjs.org has an excellent tutorial on how to add react js to an existing website
Error while trying to run scripts: regeneratorRuntime is not defined
I have problem to run a test in mocha and chai. i am getting an error: error while trying to run scripts:
MUI Strange Code in Button Component , hope anyone can explain
This is some code from material ui
Importing default exports are undefined
Im using typescript with babel 7, webpack 4 and react. export default () => <span>test</span> and
Ad
to install babel in windows
I want to install babel(windows). but i got error.how can i fix this? staff ~/desktop/react $
How to write proper private method in JavaScript class with Babel?
I was doing graphql tutorial from apollo server. now i am trying to add batching from this part -
Webpack: npm start "Module not found: Error: Can't resolve ..." after moving location for webpack / react files
My project was working and i was able to view my web page on localhost:8080 while using chrome. i was trying to learn something so i had all my
Got 'Cannot find module' error when I tried to import certain JS file
I am currently learning js and this is codes from practice. (which is from ydkjsy) this is a publication.js
Syntax Error unexpected token : when impoting component from outside react app repository
I created a react application into my react native application so this is the structure of my global app : ------app
Babel plugin transform-remove-console not working with Vue CLI 4 @vue/cli-plugin-babel/preset?
With a vuejs project created by vue cli 4, you get babel configured with this handy preset in babel.config.js:
Configure inline image import in Babel
I'm using react.js and babel, and importing png images of different sizes (some of them are more than 10kb of size). and when loaded to the
Can’t read siteMetadata object from gatsby-config.js file with Gatsby and Typescript
I am trying to read the content of sitemetadata object i defined in gatsby-config.js file, but each time i try i get this error
React: How can I show only where a boolean is set to false with Array.map()?
I have a simple array with objects, these objects contain a boolean value. when rendering like this, it shows every single object.
Plugins[0][1] must be an object, false, or undefined
I have been trying to upgrade my packages and things have started to fall apart and i am now unable to build and cannot seem to figure out what is
POST request returns undefined
When the request from postman initiated with the json as given below, i get hello undefined as response. request json
Ad
class doesn't get compiled by babel (nextjs / webpack)
Problem: my site uses next js. on 2 pages i get script1002: syntax error in ie because of a class
Error when running jest on a react native + typescript app (Jest encountered an unexpected token)
It seems like everyone and their mother are having a variation of this problem. nothing worked from everything i have tried from all the so
Cannot find module 'babel-preset-env' from PATH Did you mean "@babel/env"?
Jest cli suddently has stopped working, all test fails with: cannot find module 'babel-preset-env' from '/path' - did you mean
Promise returns with 'undefined' or babel compiled code doesn't wait for return (async/await)
There is an async function (send) in which if the msg attribute is not defined, another function
React.js code is not running after installing it using nodejs through npm installer
I was trying to learn react, so i have this sample code of my first react app, and i am trying to get it work but after running npm install
node_modules outside of the project directory are not transpiled by Babel (7)
I'm writing an application based on symfony4 and reactjs and i'm using the webpack encore to build a bundle. also the
JSX: You may need an appropriate loader to handle this file type
Attempting to configure my build environment to parse react and jsx with the following. however i am getting the dreaded "you may need an
Laravel Mix: Configure Babel for IE11 compatibility (transformations and polyfills)
In a laravel 6 application with laravel-mix 4, and using the vue preset, i need to compile my javascript code to be compatible for ie11. this
How to transpile node cli app using babel
I am writing mt first cli app with node and i am facing some issues using babel to transpile my code. basically, the app should start an express
React Development and Build version not working in IE 11 and Edge - Webpack/Babel
Development and build version not working in ie 11 and edge. here are my webpack config and package json file. i have used below repo.
"Expected corresponding JSX closing tag for <span>"
Yesterday, i was starting a new project in nextjs. i was trying to build a login component. something easy . but when i compiled the code, the
Ad
Do I need to use Babel in project which created backend service with Node.js and front end part with view engine with ejs?
I am a little bit confused. someone says if you are going to develop pure node.js projects, you don't have to worry about this. for web you should
Failed to get mock metadata (babel 7 upgrade)
I am mocking out a git submodule (which is essentially just a javascript library we use at work), and all my mocks started returning:
Export { default } not supported in React app
I'm facing problems after update @atalaskit/form from
SyntaxError: Missing class properties transform
I have problem with babel transform. after add handle event in my react container i got this error. syntaxerror: missing class properties
How to solve the problem Support for the experimental syntax 'classProperties' isn't currently enabled
I have this error support for the experimental syntax 'classproperties' isn't currently enabled when i try to run the react
Babel problem while having a local node modules in my src folder
I have created a local node module and i have configured the webpack to consider this module (module is in src/component):
CSS file causing error in react/webpack configuration
I have a fullstack project, which is made with django-rest and react as the frontend. everytime i try to load a css file into my react
"ReferenceError: waitForElement is not defined" when testing react.js
I am testing with jest and react-testing-library a component that is calling an async function. when i run the test i get the error
Custom HTML attributes on React component
I'm trying to add a custom html attribute on a react component: const parent = () => ( <div classname="parent">
webpack/typescript/react - Err: Unexpected token React.Component
I am trying to set up a project with webpack, typescript and react. i am using babel to transpile my typscript/react code. on starting the
Why does Jest error with Maximum Call Stack Size Exceeded When I Import KnockoutJS Into A ViewModel I'm Testing?
I'm trying to write some tests using jest for a knockoutjs project. apologies for any terminology i get wrong below i'm coming back to js
Ad
React-Testing-Library: using typescript can't pass component to render function
I was bootstrapping my first typescript + react project from scratch. i was successful with the typescript and component rendering. however, as i
Webpack not loading output files in localhost even after compiling successfully
Below is my piece of code for webpack: module.exports = env => { return { entry: './src/index.js', devtool:
How to fix 'Cannot find module 'babel-types'
I'm trying to setup react with babel and following this video
React Component not loading with Webpack and Babel Beginner's level
I am trying to understand how react, babel and webpack interact with each other, but i get the following error: uncaught typeerror: super
Requires Babel "^7.0.0-0", but was loaded with "6.26.3" on a react-xml-parser package - already tried all the current solutions
I've already tried a lot of solutions given by the github community about this matter, but none seems to work for me.
Different babel or webpack configuration based on entry point
In my application, i am applying babel using webpack (which i use to generate my bundles from my source files). i create
Gatsby fail to compile with flow
I have installed flow in my gatsby project, by adding the plugin gatsby-plugin-flow. it has created a .flowconfig file in project root and
Does React build size change due to named and default imports
I am new to react development and have been using named and default imports. i need to know whether importing a default export and using its named
Config antd with react and webpack
Here is the error i receive: uncaught error: module parse failed: unexpected token (15:5) you may need an appropriate loader
I can't run my node server Babel compilation error
I'm following this
Uncaught SyntaxError: Unexpected token in import React from 'react'
I used to write a react app by using create-react-app and there was no problem. however, i tried to make a small app using only index.html and
Ad
Unhandled JS Exception: Can't find variable: require
React native version: 0.57.3 android: google pixel 3 api - 28 ios: iphone 8 plus - 11.4 react-native-web: 0.10.0 i
Inline import by ES6 modules in Node.js
In an "old way" of managing modules in node.js (commonjs modules) you can do something like this: example of express.js route:
when I try to install by npm it frezzes in this step exactly
I was triyng to install babel and webpack by npm in command line but when i type npm install it frezzes in this step exactly :
How can I use Webpack to create bundle for a Rest API Express NodeJS Server
Hope you are all well :) i was working on a rest api server with nodejs and after completing an alpha version, i wanted to create a bundle
Tanspiling & Polyfilling vs browser performance optimizations
Well, i know we need transpilers & pollyfills to keep backward compatibility (in order) at scale of a
React displays blank page after app build?
After running the command npm run build i got the build files without any error but once when i try to run the app it's showing blank page and
Transpile using babel-preset-env without ejecting from create-react-app
I create a react project using create-react-app. and in order to pack it to run elsewhere, i use docker with this config file: my
ReferenceError: Unknown option: .present
Hello i just made environment setup for react js and it gives me error referenceerror: unknown option: .present. and here is codes
Babel 7 spread syntax in IE/Edge not working
So i have babel 7 installed, along with the plugin "@babel/plugin-proposal-object-rest-spread" included within my preset-env, however i'm still
External React component library JSX Babel wont compile
I'm trying to extract certain compoennts in my react application to a separate reusable component library. what i've done, is cloned this
Adding classes with React
I have a basic component that i'd like to use in multiple instances with differing classes. <div classname="module
Ad
Babel plugins - Member access with index
I am writing a babel plugin. i came across a place where i need to use index operator. this is code i want to get
How to pass Babel7 config file path to mocha and gulp-mocha?
In babel7 we have babel.config.js file. the path to this file we can pass via configfile or config-file
Convert Javascripts for IE10
I need to convert this function to work with ie10. i thought to use babel to convert the file from es6 to es5, but i dont know how to use
Something in your build process is loading the wrong version
I am getting following error. can't figure out solution. i found many post which looks duplicate here but, nothing work. like:
react-intl and babel won't export messages, error in presets
Running react and react-intl package with translations in formattedmessage elements. when i attempt to run babel-plugin-react-intl, which should
ESLint: Why is Symbol not defined (no-undef rule)?
In a typescript project that i've recently setup, i've gotten babel to compile my typescript code. i'm also using @typescript-eslint
react-styleguidist error for fresh react-create-app?
Trying to set up documentation for a react based project. using a fresh 'my-app' from 'create-react-app' and a very naive *.js file i get
How to transpile one particular file / folder inside node_module from es6 to es5 using babel-loader?
1.ie11 doesn’t support es6 syntax in code . it will throw error if it encounters any es6 syntax. 2.we are having es6 syntax inside
spawn babel-node ENOENT
I am building a react app from scratch with yarn and not npm as yarn is fast than npm. i am not using
Error finding core node modules during webpack build in windows
I am trying to write modern es code in node.js. for that i am trying to configure babel using webpack. i am not able to build my source files
How to turn off tokenization of specific files with VSCode
I am writing javascript with vscode. the written code is transpiled with babel and bundled with webpack to generate a file called
Ad
How to add compiled javascript library to typescript project?
I have an typescript project (projecta) that uses few nodes packages. aside i have babel project (projectb) which build configuration supports
webpack/react/babel doesn't compile JSX
I know there are a lot of similar questions but i didn't found the solution and some of them are old so they don't apply. i've created a
Ad
Blog Categories
Ad