ERROR in ./static/js/index.js
Module build failed (from ./node_modules/babel–loader/lib/index.js):
TypeError: this.getOptions is not a function
报错原因:使用了高版本的babel–loader,导致babel–loader和babel–core版本冲突,我降低之前babel–loader为9版本
npm install -D babel-loader@7 babel-core babel-preset-env
{
"name": "djangomall",
"version": "0.0.0",
"description": "djangomall app",
"main": "index.js",
"scripts": {
"watch": "set NODE_OPTIONS=--openssl-legacy-provider && webpack --mode=development --progress --watch",
"test": "echo "Error: no test specified" && exit 1"
},
"author": "jacky",
"license": "ISC",
"devDependencies": {
"@babel/preset-react": "^7.18.6",
"babel-core": "^4.7.16",
"babel-loader": "^7.1.5",
"babel-preset-env": "^1.7.0",
"cross-env": "^7.0.2",
"css-loader": "^4.1.1",
"style-loader": "^1.1.2",
"webpack": "^4.43.0",
"webpack-bundle-tracker": "^0.4.3",
"webpack-cli": "^3.3.11"
},
"dependencies": {
"bootstrap": "^5.2.3",
"react": "^18.3.0-next-8310854ce-20230331",
"react-dom": "^18.3.0-next-8310854ce-20230331"
}
}
原文地址:https://blog.csdn.net/weixin_43883625/article/details/129913007
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若转载,请注明出处:http://www.7code.cn/show_34554.html
如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱:suwngjj01@126.com进行投诉反馈,一经查实,立即删除!
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。