简体   繁体   中英

“babel” is read-only with react jsx

I am importing babel to my jsx file like below. But i get error for Module build failed: SyntaxError: "babel" is read-only

var babel = require("babel-core");
import { transform } from 'babel-core';
import * as babel from 'babel-core';

I guess the error is because you are using same variable name babel .

var babel = require("babel-core");
import * as babel from 'babel-core';

Use different names and try again.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM