Cannot assign to read only property exports of object 太过爱你忘了你带给我的痛 2023-10-07 08:54 158阅读 0赞 一、问题介绍:在webpack项目中使用@babel/plugin-transform-runtime时,报错 ERROR in Error: E:\workdata\webpackVue/node_modules/_@babel_runtime@7.4.5@@babel/runtime/helpers/ typeof.js?:33module.exports = _typeof;^TypeError: Cannot assign to read only property ‘exports’ of object ‘#‘- typeof.js?:33 Module.eval[.]/[_@babel_runtime@7.4.5@@babel]/runtime/helpers/typeof.js?16 - typeof.js?:34 eval 在网上查了一下,具体原因是项目中文件存在语法冲突, 就是在webpack打包的时候,可以在js文件中混用require和export。但是不能混用import 以及module.exports。 因为webpack中不允许混用import和module.exports, 二、解决方案:1、统一改成ES6的方式编写即可import {test} from './test';export default test;2、添加插件npm install --save-dev @babel/plugin-transform-modules-commonjs在项目根目录新增.babelrc文件,并在文件中加入 { "plugins": ["@babel/plugin-transform-modules-commonjs"]} 然后重新启动项目就OK了。 它类似一种打补丁,会把项目中需要转换语法的文件转换。
相关 使用heatmap.js出现Cannot assign to read only property ‘data‘ of object ‘#<ImageData>‘问题。 Cannot assign to read only property ‘data’ of object ImageData 问题解决 去你的node\_modules/h 末蓝、/ 2023年10月14日 12:34/ 0 赞/ 19 阅读
相关 Cannot read properties of undefined (reading ‘length‘) 问题:Cannot read properties of undefined (reading 'length') ![22c42ccc03e44684d66ebc8c3c5 清疚/ 2023年10月10日 16:12/ 0 赞/ 177 阅读
相关 Vue项目运行后控制台报错Cannot assign to read only property ‘exports‘ of object ‘#<Object>‘ 配置babelrc lang.js无需更改,只需要配置.babelrc即可,首先下载相应babel插件 npm install babel-plugin-trans 我就是我/ 2023年10月07日 22:49/ 0 赞/ 128 阅读
相关 Cannot assign to read only property exports of object 一、问题介绍: 在webpack项目中使用@babel/plugin-transform-runtime时,报错 ERROR in Error: E:\\workdat 太过爱你忘了你带给我的痛/ 2023年10月07日 08:54/ 0 赞/ 159 阅读
相关 Vue Uncaught TypeError: cannot assign to read only property Uncaught TypeError: /cannot assign to read only property ‘exports’ of object '\' 前言 公 旧城等待,/ 2023年06月24日 13:27/ 0 赞/ 121 阅读
相关 【解决】BaseClient.jsUncaught TypeError: Cannot assign to read only property 'exports' of object ![å¨è¿éæå¥å¾çæè¿°][watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmN 淡淡的烟草味﹌/ 2023年06月18日 07:59/ 0 赞/ 41 阅读
相关 Uncaught TypeError: Cannot assign to read only property 'exports' of object ' Uncaught TypeError: Cannot assign to read only property 'exports' of object '\ 错误 た 入场券/ 2023年05月29日 13:07/ 0 赞/ 92 阅读
相关 TypeError: Cannot assign to read only property ‘xxx‘ of object ‘#xxx‘ 在vue.js项目开发的时候遇到报错:TypeError: Cannot assign to read only property 'xxx' of object '\xxx' 以你之姓@/ 2022年11月22日 00:28/ 0 赞/ 314 阅读
相关 recoil error Cannot assign to read only property of object ‘#‘ Cannot assign to read only property of object ‘\’ recoil 对象引用值不能修改,可以在atom后添加 dangero 男娘i/ 2022年11月21日 09:58/ 0 赞/ 256 阅读
相关 react编译错误:Cannot assign to read only property ‘exports‘ of object ‘#<Object>‘ 使用create-react-app脚手架搭建了一个react项目,在项目中拷贝了其他项目中的一些组件代码,在编译时报如下错误: Cannot assign to r 忘是亡心i/ 2021年06月22日 15:38/ 0 赞/ 779 阅读
还没有评论,来说两句吧...