gpt4 book ai didi

vue.js - 如何修复 : this. setDynamic 不是函数

转载 作者:搜寻专家 更新时间:2023-10-30 22:49:37 27 4
gpt4 key购买 nike

我的 babel 配置有一些问题,不确定是什么..

我看到的错误:

 ERROR  Failed to compile with 1 errors                                                                                          friendly-errors 21:27:50


ERROR in ./.nuxt/client.js friendly-errors 21:27:50

Module build failed (from ./node_modules/@nuxt/webpack/node_modules/babel-loader/lib/index.js): friendly-errors 21:27:50
TypeError: this.setDynamic is not a function

我的 .babelrc 看起来像这样:

{
"presets": [
[
"vue-app",
{
"useBuiltIns": true
}
],
"flow"
],
"plugins": ["@babel/plugin-proposal-decorators", "@babel/plugin-proposal-class-properties"],
"env": {
"test": {
"plugins": ["babel-jest-assertions", "transform-runtime"]
}
}
}

包锁,已安装的插件:

"@babel/core": "^7.4.5",
"@babel/preset-env": "^7.4.5",
"@nuxtjs/google-analytics": "^2.2.0",
"acorn": "^6.1.1",
"axios": "^0.18.1",
"babel-jest-assertions": "^0.1.0",
"babel-plugin-transform-decorators-legacy": "^1.3.5",
"babel-preset-flow": "^6.23.0",

需要更改什么才能使此配置正常工作?已访问各种 stackoverflow 答案,但尚未找到有效的修复方法。

评论后更新的配置:

"@babel/plugin-transform-runtime": "^7.4.4",
"@babel/polyfill": "^7.4.4",
"@vue/babel-preset-app": "^3.0.0-rc.2",
"autoprefixer": "^7.1.2",
"babel-core": "^6.26.3",
"babel-eslint": "^8.2.3",
"babel-helper-vue-jsx-merge-props": "^2.0.3",
"babel-jest": "^21.0.2",
"babel-loader": "^8.0.0-beta.0",
"babel-plugin-dynamic-import-node": "^1.2.0",
"babel-plugin-syntax-jsx": "^6.18.0",
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.0",
"babel-plugin-transform-imports": "^1.5.1",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-plugin-transform-vue-jsx": "^3.5.0",
"babel-preset-env": "^1.3.2",
"babel-preset-stage-2": "^6.22.0",
"babel-register": "^6.22.0",

最佳答案

这个问题的答案是这样的。请注意您的 babel 配置,即评论中提到的配置。 Babel 6 将无法与 Babel 7 插件等一起正常工作。感谢您在评论中提供的所有帮助。

关于vue.js - 如何修复 : this. setDynamic 不是函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56502731/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com