Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/tfs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Internet explorer “;对象没有';t支持属性或方法';查找'”;在IE11中,带着巴别塔和包裹_Internet Explorer_Babeljs_Parcel - Fatal编程技术网

Internet explorer “;对象没有';t支持属性或方法';查找'”;在IE11中,带着巴别塔和包裹

Internet explorer “;对象没有';t支持属性或方法';查找'”;在IE11中,带着巴别塔和包裹,internet-explorer,babeljs,parcel,Internet Explorer,Babeljs,Parcel,我在IE11中不断遇到这个错误,它会停止所有其他js代码的工作。似乎babel没有编译使用“find”方法的代码。我已经没有东西可以用谷歌了:) 我需要一个巴别塔插件吗 My babel.config.json: { "presets": [ [ "@babel/env", { "targets": { "edge"

我在IE11中不断遇到这个错误,它会停止所有其他js代码的工作。似乎babel没有编译使用“find”方法的代码。我已经没有东西可以用谷歌了:)

我需要一个巴别塔插件吗

My babel.config.json:

    {
    "presets": [
      [
        "@babel/env",
        {
          "targets": {
            "edge": "17",
            "firefox": "60",
            "chrome": "67",
            "safari": "11.1",
            "ie": "11"
          },
          "useBuiltIns": "usage",
          "corejs": "3.6.5"
        }
      ]
    ]
  }
My package.json:

{
  "name": "assets",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "build": "parcel build ./assets/bundle.ts --public-url ./ -d ui",
    "watch": "parcel watch ./assets/bundle.ts --public-url ./ -d ui"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "@babel/cli": "^7.12.1",
    "@babel/core": "^7.12.3",
    "@babel/preset-env": "^7.12.1",
    "@types/throttle-debounce": "^2.1.0",
    "autoprefixer": "^9.8.6",
    "cssnano": "^4.1.10",
    "normalize-scss": "^7.0.1",
    "postcss": "^8.1.4",
    "postcss-modules": "^3.2.2",
    "sass": "^1.27.0",
    "typescript": "^4.0.5"
  },
  "dependencies": {
    "@babel/polyfill": "^7.12.1",
    "@splidejs/splide": "^2.4.14",
    "babel": "^6.23.0",
    "plyr": "^3.6.2",
    "throttle-debounce": "^3.0.1"
  }
}

错误会在哪一行和哪一个文件中抛出

我猜您使用的是
Array.prototype.find()
,它是。您还可以在页面上找到此方法的。我建议您在代码中包含polyfill,以便它可以与IE 11一起使用

此外,我发现下面的polyfill也可以使用。您还可以将其包含在代码中:

<script src="https://cdn.polyfill.io/v3/polyfill.min.js?features=default,Array.prototype.includes,Array.prototype.find"></script>

Hi@Ladefuss这个问题怎么样?我下面的回答是否有助于解决这个问题?如果是这样,你可以参考,它可以帮助其他社区成员在未来的类似问题。谢谢你的理解。