首页 > 解决方案 > '$' 是在 IE 11 中运行的反应应用程序中的未定义错误

问题描述

我如何摆脱错误'$'在 IE 11 中未定义?我正在使用对打字稿做出反应(traget es2015)。webpack config 中的 Babel 配置如下所示

         test: /\.(tsx|ts)$/,
                loader: "awesome-typescript-loader",
                exclude: /node_modules/,
                options: {
                    "useBabel": true,
                    "babelOptions": {
                        "babelrc": false, /* Important line */
                        "presets": [
                            '@babel/preset-env',
                            "@babel/preset-react"
                        ],
                        "plugins": [
                            [
                                "@babel/plugin-transform-classes", { "loose": true }
                            ],
                            [
                                "@babel/plugin-transform-regenerator", { "asyncGenerators": false, "generators": false, "async": false }
                            ],
                            [
                                "@babel/plugin-transform-parameters"
                            ],
                            [
                                "@babel/plugin-transform-block-scoping"
                            ],
                            [
                                "@babel/plugin-transform-typeof-symbol"
                            ]
                        ]
                    },
                    "babelCore": "@babel/core"
                }

标签: reactjsinternet-explorerbabeljs

解决方案


问题出在 googleapi 地图脚本中。由于 polyfill,我收到了一个字符串预期错误,这导致了另一个错误。


推荐阅读