首页 > 解决方案 > 如何配置在 ie 11 上运行的 Nuxt.js

问题描述

我使用Nuxt.js @ v2.13.2并尝试配置我的项目ie 11

医生说:

The default targets of @nuxt/babel-preset-app are ie: '9' in the client build, and node: 'current' in the server build.

这是我的nuxt.config.js

build: {
    babel: {
      presets({ isServer }, [ preset, options ]) {
        // change options directly
        options.buildTarget = 'client'
        options.targets = {
          ie: 11,
        }
      }
    }
}

还有我的页面

import Amplify from 'aws-amplify';
import awsconfig from './aws-exports';

Amplify.configure(awsconfig);

但它不工作ie 11

[object Error]{description: "Syntax error", message: "Syntax error", name: "SyntaxError", number: -2146827286, stack: "SyntaxError...", Symbol(amplify_default)_i.icdaor5bqh3: undefined, Symbol(extensions)_k.icdaor5bqh3: undefined, Symbol(observable)_j.icdaor5bqh3: undefined, Symbol(react.element)_h.icdaor5bqh3: undefined

怎么做谢谢。

标签: vue.jsvuexnuxt.jsaws-amplify

解决方案


据我所知,问题在于 Symbol polyfill 不支持跨领域的原生功能。

更多细节在这里:https ://github.com/zloirock/core-js/issues/834


推荐阅读