vue引用xlsx-style组件 报错:This relative module was not found: ./cptable in ./node_modules/xlsx-style
这个是前端 vue 中的 Excel 文件导出时用到的程序启动的时候出现错误,显示:not found ./cptable in node_modules/xlsx-style/dist/cpexcel.js这个不是程序的问题,而是,在该文件目录下面,有段程序写错了,在该js文件里,第807行,var cpt = require(’./cpt’ + ‘able’);有误,改成 var cpt =
这个是前端 vue 中的 Excel 文件导出时用到的
程序启动的时候出现错误,显示:not found ./cptable in node_modules/xlsx-style/dist/cpexcel.js
这个不是程序的问题,而是,在该文件目录下面,有段程序写错了,
在该js文件里,第807行,var cpt = require(’./cpt’ + ‘able’);有误,
改成 var cpt = cptable; 就可以正确启动程序了
问题所在:\node_modules\xlsx-style\dist\cpexcel.js 807行 var cpt = require('./cpt' + 'able');
解决方案1: 修改为 var cpt = cptable 修改的只是本地文件
解决方案2:webpack.base.conf.js
module.exports = {
externals: [ {
'./cptable': 'var cptable'
}]
}
参考链接:
not found cptable in node_modules/xlsx-style/dist/cpexcel.js
https://blog.csdn.net/qq_24044863/article/details/100011265
vue引用xlsx-style组件 报错:This relative module was not found: ./cptable in ./node_modules/xlsx-style
更多推荐
所有评论(0)