SCRIPT1028: SCRIPT1028: Expected identifier, string or number - reactjs

I am working on an React App, and I can not open this app in Safari and IE.
For IE-11: SCRIPT1028: SCRIPT1028: Expected identifier, string or number
For Safari(10.1.2) : SyntaxError: Unexpected token '...'. Expected a property name.
my package.json file is as..
"dependencies": {
"#babel/core": "^7.0.0",
"#babel/plugin-proposal-object-rest-spread": "^7.6.2",
"#storybook/addon-backgrounds": "^3.4.8",
"#storybook/react": "^4.0.0-alpha.4",
"#types/d3": "^5.0.0",
"#types/debug": "^0.0.30",
"#types/enzyme": "^3.1.9",
"#types/jest": "^23.1.4",
"#types/moment-timezone": "^0.5.4",
"#types/react": "^16.9.11",
"#types/react-dom": "^16.9.3",
"#types/react-intl": "^2.3.16",
"#types/react-mentions": "2.4.0",
"#types/react-redux": "^7.1.5",
"#types/react-router": "^5.1.2",
"#types/react-router-dom": "^5.1.0",
"#types/react-select": "^1.2.6",
"#types/react-show-more": "^2.0.1",
"#types/reactour": "^1.13.1",
"#types/redux": "^3.6.0",
"#types/redux-form": "^7.3.1",
"#types/redux-logger": "^3.0.6",
"#types/storybook__addon-backgrounds": "^3.2.0",
"#types/storybook__react": "^3.0.8",
"#types/styled-components": "^4.1.19",
"awesome-typescript-loader": "^5.2.0",
"axios": "^0.18.0",
"babel-engine-plugin": "^0.3.0",
"babel-loader": "^7.0.0",
"babel-register": "^6.26.0",
"connected-react-router": "^4.4.1",
"cosed": "^1.1.8",
"d3": "^5.7.0",
"date-fns": "^1.29.0",
"debug": "^3.1.0",
"duplicate-package-checker-webpack-plugin": "^3.0.0",
"emoji-mart": "^2.6.1",
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.1.1",
"gen-tester": "^3.1.2",
"history": "^4.10.1",
"html-loader": "^0.5.5",
"html-webpack-plugin": "^3.1.0",
"husky": "^0.14.3",
"immer": "^1.3.1",
"jest": "^23.3.0",
"jest-environment-enzyme": "^6.0.2",
"jest-enzyme": "^6.0.2",
"jest-styled-components": "^6.0.0",
"lint-staged": "^7.2.0",
"moment-timezone": "^0.5.14",
"prettier": "^1.13.7",
"prop-types": "^15.7.2",
"react": "^16.11.0",
"react-cosed": "^1.0.9",
"react-dom": "^16.11.0",
"react-intl": "^2.8.0",
"react-redux": "^5.1.1",
"react-router": "^5.1.2",
"react-router-dom": "^5.1.2",
"react-select": "^1.2.1",
"reactour": "^1.15.4",
"redux": "^4.0.0",
"redux-cosed": "^1.0.1",
"redux-form": "^8.2.6",
"redux-persist": "^5.10.0",
"redux-thunk": "^2.3.0",
"styled-components": "^4.4.1",
"ts-jest": "^23.0.0",
"tslint": "^5.9.1",
"tslint-config-prettier": "^1.13.0",
"tslint-no-circular-imports": "^0.5.0",
"typescript": "^3.0.1",
"uglifyjs-webpack-plugin": "^1.2.7",
"url-loader": "^1.0.1",
"webpack": "^4.15.1",
"webpack-cli": "^3.0.8",
"webpack-dev-server": "^3.1.5",
"webpack-merge": "^4.1.3"
},
"devDependencies": {
"#types/lodash.debounce": "^4.0.4",
"firebase-tools": "^6.1.0",
"lodash.debounce": "^4.0.8"
}
If some more details needed please let me know.
Please suggest, what do i need to do.... Thanks
My webpack.js file is as....
const path = require('path');
const HtmlWebPackPlugin = require('html-webpack-plugin');
const {
CheckerPlugin,
TsConfigPathsPlugin,
} = require('awesome-typescript-loader');
const DuplicatePackageCheckerPlugin = require('duplicate-package-checker-webpack-plugin');
const ROOT = path.resolve(__dirname, '..');
module.exports = {
module: {
rules: [
{
test: /.tsx?$/,
use: 'awesome-typescript-loader',
exclude: /node_modules/,
},
{
test: /.(png|jpg|gif|svg)$/,
use: [
{
loader: 'url-loader',
options: {
limit: 25000,
},
},
],
},
{
test: /.html$/,
use: 'html-loader',
},
],
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
modules: [path.resolve(ROOT, 'shared'), 'node_modules'],
plugins: [new TsConfigPathsPlugin()],
},
plugins: [
new HtmlWebPackPlugin({
template: path.join(ROOT, 'shared', 'index.html'),
filename: './index.html',
}),
new CheckerPlugin(),
new DuplicatePackageCheckerPlugin(),
],
};
I think babel-loader will work but can't find any way to use babel-loader. I need this app to run on ie11 and safari as well.
Please suggest some solution...

The issue is that by default the application was being rendered on IE7, that is - not on IE11/Edge that supports the transpiled build. So I had to mention the meta information to let the browser know that the intended browser is IE11/Edge. Add this to the head section of your index.html:
<meta http-equiv="X-UA-Compatible" content="IE=edge">
Now you might be getting some errors in the console that read SCRIPT5009: 'Set' is undefined - refer to the below link relating to polyfills for the Set collection type:
React JavaScript Environment Requirements
For more information on the issue see:
React app not rendering in IE11 and below

Because you are opening it in Microsoft edge, try opening it in latest chrome version... problem will be solved.....this works for ReactJs projects

Related

vue2 to react migration, tsx module not found

I have a vue2 app which does not implement typescript. I have decided to migrate the app to react. Thought process is to implement new features in react and let the old features run in vue. This is what I have done so far.
Created a new react-migration folder which will have all the new features.
Tried two ways to use the HelloWorld component
Create a react wrapper which takes the react component and renders it.
<template>
<div ref="container" />
</template>
<script>
import { createElement } from "react";
import { createRoot } from "react-dom/client";
export default {
inheritAttrs: false,
props: {
component: {
type: Function,
required: true,
},
},
data() {
return {
reactRoot: null,
};
},
watch: {
$attrs: {
deep: true,
handler() {
this.updateReactComponent();
},
},
},
mounted() {
this.reactRoot = createRoot(this.$refs.container);
this.updateReactComponent();
},
destroyed() {
this.reactRoot.unmount();
},
methods: {
updateReactComponent() {
this.reactRoot.render(createElement(this.component, this.$attrs));
},
},
};
</script>
Used veaury package to do the same.
Issue :
I have added all the ext in the config file.
extensions: ['*', '.js', '.vue', '.json','.tsx','.ts','.jsx']
I believe its because my vue project is not able to recognise the react tsx file.
All the help is appreciated.
Implementation reference articles
Veary implementation reference
React to vue migrations reference
package.json dependencies
"dependencies": {
"#cypress/vue": "^2.2.4",
"#fortawesome/fontawesome-svg-core": "^1.2.36",
"#fortawesome/free-brands-svg-icons": "^5.15.4",
"#fortawesome/free-regular-svg-icons": "^5.15.4",
"#fortawesome/free-solid-svg-icons": "^5.15.4",
"#fortawesome/vue-fontawesome": "^2.0.2",
"#tiptap/extension-character-count": "^2.0.0-beta.12",
"#tiptap/extension-collaboration": "^2.0.0-beta.19",
"#tiptap/extension-collaboration-cursor": "^2.0.0-beta.20",
"#tiptap/extension-font-family": "^2.0.0-beta.207",
"#tiptap/extension-highlight": "^2.0.0-beta.14",
"#tiptap/extension-link": "^2.0.0-beta.18",
"#tiptap/extension-table": "^2.0.0-beta.24",
"#tiptap/extension-table-cell": "^2.0.0-beta.13",
"#tiptap/extension-table-header": "^2.0.0-beta.15",
"#tiptap/extension-table-row": "^2.0.0-beta.13",
"#tiptap/extension-task-item": "^2.0.0-beta.16",
"#tiptap/extension-task-list": "^2.0.0-beta.16",
"#tiptap/extension-text-style": "^2.0.0-beta.207",
"#tiptap/extension-typography": "^2.0.0-beta.207",
"#tiptap/extension-underline": "^2.0.0-beta.207",
"#tiptap/html": "^2.0.0-beta.84",
"#tiptap/prosemirror-tables": "^1.1.4",
"#tiptap/starter-kit": "^2.0.0-beta.80",
"#tiptap/vue-2": "^2.0.0-beta.39",
"#vue/babel-preset-jsx": "^1.4.0",
"#vue/cli": "^4.5.15",
"axios": "^0.19.2",
"buefy": "^0.9.4",
"canvg": "^4.0.1",
"core-js": "^2.6.5",
"dompurify": "^2.4.3",
"echarts": "^4.4.0",
"eslint-plugin-cypress": "^2.12.1",
"google-fonts-webpack-plugin": "^0.4.4",
"hooper": "^0.3.4",
"html2pdf.js": "^0.10.1",
"jspdf": "^2.5.1",
"lodash": "^4.17.21",
"moment": "^2.24.0",
"npm-run-all": "^4.1.5",
"numeral": ">=2",
"postcss-loader": "^3.0.0",
"prosemirror-commands": "^1.5.0",
"prosemirror-history": "^1.3.0",
"prosemirror-keymap": "^1.2.0",
"prosemirror-schema-list": "^1.2.2",
"raw-loader": "^0.5.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"sass": "^1.57.1",
"sass-rem": "^3.0.0",
"socket.io": "^2.3.0",
"socket.io-client": "^2.3.0",
"veaury": "^2.3.11",
"vee-validate": "^3.2.1",
"vue": "^2.6.10",
"vue-axios": "^2.1.5",
"vue-carousel": "^0.18.0",
"vue-class-component": "^7.1.0",
"vue-content-loading": "^1.6.0",
"vue-drawer-layout": "^1.3.0",
"vue-echarts": "^4.0.4",
"vue-html2pdf": "^1.8.0",
"vue-i18n": "^8.0.0",
"vue-jwt-decode": "^0.1.0",
"vue-line-clamp": "^1.3.2",
"vue-moment": "^4.0.0",
"vue-numerals": "^3.0.5",
"vue-router": "^3.1.3",
"vue-star-rating": "^1.6.1",
"vuedraggable": "^2.23.2",
"vuex": "^3.1.2",
"webpack-dev-server": "^4.7.4",
"y-indexeddb": "^9.0.6",
"y-websocket": "^1.3.15",
"yjs": "^13.5.10"
},
"devDependencies": {
"#iconify/icons-icomoon-free": "^1.2.3",
"#iconify/vue2": "^2.0.1",
"#kazupon/vue-i18n-loader": "^0.3.0",
"#types/uuid": "^9.0.0",
"#vue/cli-plugin-babel": "^3.11.0",
"#vue/cli-plugin-eslint": "^3.11.0",
"#vue/cli-service": "^3.11.0",
"#vue/eslint-config-prettier": "^5.0.0",
"babel-eslint": "^10.0.3",
"cache-loader": "^4.1.0",
"css-loader": "^3.2.1",
"cypress": "^12.3.0",
"eslint": "^5.16.0",
"eslint-config-prettier": "^6.7.0",
"eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-vue": "^5.2.3",
"file-loader": "^3.0.1",
"prettier": "^1.19.1",
"sass-loader": "^7.1.0",
"url-loader": "^2.1.0",
"vue-cli-plugin-i18n": "^0.6.0",
"vue-eslint-parser": "^7.0.0",
"vue-template-compiler": "^2.6.14",
"webpack": "^4.46.0"
}

React-Native "/Components` could not be found from " Error

This is my first question on Stack.
I am trying to run react-native project.But i have this problem
i tried to start with npx,lots of times delete node modules and reinstall npm.
Also at every starting use -- --reset-cache. and run "npm install then react-native upgrade --legacy"
"dependencies": {
"#react-native-async-storage/async-storage": "^1.14.1",
"#react-native-community/masked-view": "^0.1.10",
"#react-navigation/bottom-tabs": "^5.11.8",
"#react-navigation/native": "^5.9.3",
"#react-navigation/stack": "^5.14.3",
"#reduxjs/toolkit": "^1.5.0",
"#thecodingmachine/redux-toolkit-wrapper": "^1.3.0",
"axios": "^0.21.1",
"i18next": "^19.9.1",
"jetifier": "^1.6.6",
"react": "16.8.3",
"react-i18next": "^11.8.8",
"react-native": "^0.59.9",
"react-native-appearance": "^0.3.4",
"react-native-flipper": "^0.78.0",
"react-native-gesture-handler": "^1.0.16",
"react-native-onboarding-swiper": "^1.1.4",
"react-native-reanimated": "^1.13.2",
"react-native-safe-area-context": "^3.1.9",
"react-native-screens": "^2.18.0",
"react-navigation": "^4.4.4",
"react-redux": "^7.2.2",
"react-router-native": "^5.2.0",
"reactjs-components": "^5.0.3",
"redux": "^4.0.5",
"redux-flipper": "^1.4.2",
"redux-persist": "^6.0.0",
"then": "0.0.1",
"upgrade": "^1.1.0"
},
"devDependencies": {
"#babel/core": "7.13.1",
"#babel/runtime": "^7.13.7",
"#react-native-community/eslint-config": "^2.0.0",
"babel-jest": "26.6.3",
"babel-plugin-module-resolver": "^4.1.0",
"eslint": "^7.21.0",
"eslint-import-resolver-babel-module": "^5.2.0",
"eslint-plugin-import": "^2.22.1",
"jest": "26.6.3",
"metro-react-native-babel-preset": "0.65.1",
"react-test-renderer": "16.8.3"
},
"jest": {
"preset": "react-native",
"moduleFileExtensions": [
"ts",
"tsx",
"js",
"jsx",
"json",
"node"
],
"moduleNameMapper": {
".+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2)$": "identity-obj-proxy"
},
"setupFiles": [
"./jest.setup.js"
],
"timers": "fake",
"testEnvironment": "jsdom"
i tried lots of things but here is the conclusion;
error: bundling failed: Error: Unable to resolve module `../../Components` from `/home/egehan/Masaüstü/mobile-master/src/Containers/Example/Index.js`: The module `../../Components` could not be found from `/home/egehan/Masaüstü/mobile-master/src/Containers/Example/Index.js`. Indeed, none of these files exist:
* `/home/egehan/Masaüstü/mobile-master/src/Components(.native||.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx) ```

babel 7 how to connect polyfill correctly?

How to connect polyfill correctly?
I read all the documentation Babel 7 and followed it. Below you can see my settings.
if I add this in the webpack config
entry: [
'core-js/stable',
'regenerator-runtime/runtime',
'./main.js'
],
then everything works. but according to the documentation this line can be removed, since all the settings in the babel.config.js
If i remove from entry this line, redux store not working in IE11
babel.config.js
module.exports = function (api) {
api.cache(true);
return {
presets: [
[
'#babel/preset-env',
{
debug: true,
useBuiltIns: 'entry',
corejs: {
version: '3.6',
proposals: false
},
}
],
'#babel/preset-react',
'rsuite'
],
plugins: [
'react-hot-loader/babel',
'#babel/plugin-proposal-class-properties',
'#babel/plugin-proposal-export-default-from',
'#babel/plugin-proposal-object-rest-spread',
'#babel/plugin-syntax-object-rest-spread',
'#babel/plugin-transform-arrow-functions',
'#babel/plugin-transform-async-to-generator',
'#babel/plugin-transform-classes',
'#babel/plugin-transform-parameters',
'#babel/plugin-transform-property-literals',
['#babel/plugin-transform-runtime',
{
corejs: {
version: 3,
proposals: true
}
}
],
'#babel/plugin-transform-spread',
'#babel/plugin-transform-template-literals',
'babel-plugin-styled-components',
]
};
};
package.json
"devDependencies": {
"#babel/core": "^7.9.0",
"#babel/plugin-proposal-class-properties": "^7.8.3",
"#babel/plugin-proposal-export-default-from": "^7.8.3",
"#babel/plugin-proposal-export-namespace-from": "^7.8.3",
"#babel/plugin-proposal-object-rest-spread": "^7.9.5",
"#babel/plugin-syntax-object-rest-spread": "^7.8.3",
"#babel/plugin-transform-arrow-functions": "^7.8.3",
"#babel/plugin-transform-async-to-generator": "^7.8.3",
"#babel/plugin-transform-classes": "^7.9.5",
"#babel/plugin-transform-parameters": "^7.9.5",
"#babel/plugin-transform-property-literals": "^7.8.3",
"#babel/plugin-transform-runtime": "^7.9.0",
"#babel/plugin-transform-spread": "^7.8.3",
"#babel/plugin-transform-template-literals": "^7.8.3",
"#babel/preset-env": "^7.9.5",
"#babel/preset-react": "^7.9.4",
"#devexpress/dx-react-grid-material-ui": "^2.4.0",
"babel-eslint": "^7.2.3",
"babel-helper-annotate-as-pure": "^7.0.0-beta.3",
"babel-jest": "^23.6.0",
"babel-loader": "^8.0.2",
"babel-plugin-styled-components": "^1.10.7",
"babel-preset-rsuite": "^4.0.1",
"clean-webpack-plugin": "^3.0.0",
"colors": "^1.3.2",
"copy-webpack-plugin": "^4.5.2",
"cross-env": "^5.2.0",
"css-loader": "^3.2.0",
"eslint": "^4.19.1",
"eslint-config-airbnb": "^16.1.0",
"eslint-loader": "^2.1.1",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jsx-a11y": "^5.1.1",
"eslint-plugin-react": "^7.11.1",
"extract-text-webpack-plugin": "^4.0.0-beta.0",
"file-loader": "^2.0.0",
"html-webpack-plugin": "^3.2.0",
"image-webpack-loader": "^6.0.0",
"less": "^3.8.1",
"less-loader": "^4.1.0",
"mini-css-extract-plugin": "^0.7.0",
"optimize-css-assets-webpack-plugin": "^3.2.1",
"react-highlight-words": "^0.10.0",
"react-hot-loader": "^4.7.2",
"redux-saga": "^0.16.2",
"style-loader": "^0.23.1",
"terser-webpack-plugin": "^1.2.3",
"webpack": "^4.42.1",
"webpack-bundle-analyzer": "^3.6.1",
"webpack-cli": "^3.1.0",
"webpack-dev-server": "^3.1.8"
},
"dependencies": {
"#babel/runtime": "^7.9.2",
"#babel/runtime-corejs3": "^7.9.2",
"#hot-loader/react-dom": "^16.13.0",
"axios": "^0.19.2",
"c3": "0.4.11",
"cookie": "^0.3.1",
"core-js": "^3.6.5",
"date-fns": "^2.0.0",
"file-saver": "^2.0.2",
"jquery": "^3.4.1",
"js-base64": "^2.5.2",
"lodash": "^4.17.11",
"moment": "^2.24.0",
"normalizr": "^3.3.0",
"prop-types": "^15.7.2",
"query-string": "^5.1.1",
"ramda": "^0.26.1",
"rc-tree": "^3.1.1",
"react": "^16.8.3",
"react-datepicker": "^2.8.0",
"react-dom": "^16.8.3",
"react-html-parser": "^2.0.2",
"react-paginate": "^6.3.0",
"react-redux": "^7.1.0-rc.1",
"react-router-dom": "^4.4.0-beta.7",
"react-scrollbar": "^0.5.6",
"react-select": "^2.4.1",
"redux": "^4.0.5",
"redux-devtools-extension": "^2.13.8",
"redux-thunk": "^2.3.0",
"regenerator-runtime": "^0.13.5",
"reselect": "^3.0.1",
"rsuite": "^4.1.4",
"styled-components": "^4.1.3"
}
webpack rules
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: 'babel-loader',
},
{
test: /\.css$/,
use: cssLoaders()
},
{
test: /\.less$/,
exclude: /node_modules/,
use: cssLoaders('less-loader')
},
{
test: /\.(png|jpg|svg|gif?)$/,
use: 'file-loader'
},
{
test: /\.(woff|woff2|eot|ttf|otf?)$/,
use: 'file-loader'
},
]
},
Just don't remove these lines you've added for the polyfills
entry: [
'core-js/stable',
'regenerator-runtime/runtime',
'./main.js'
],
You are doing right, give us the link to the documentation where it is said this line can be removed. I think it's a misunderstanding.
Or maybe you are missing an other babel plugin ;)
UPDATE 2020-04-17
As it is said for #babel-polyfill
As of Babel 7.4.0, this package has been deprecated in favor of directly including core-js/stable (to polyfill ECMAScript features) and regenerator-runtime/runtime (needed to use transpiled generator functions):
So install npm i core-js and npm i regenerator-runtime
Then in your webpack config file you manage the entry points like that
...
entry: {
bundle: [require.resolve('core-js/stable'), require.resolve('regenerator-runtime/runtime'), paths.srcClient]
},
...
Then you are good to go
I think this is due to the fact that the react does not support ie10. I get an error in ie10 Set in undefined and in ie11 the redux store is not loaded. According to the documentation, the react needs to be imported polyfill globally.
https://reactjs.org/docs/javascript-environment-requirements.html

Babel 7 spread syntax in IE/Edge not working

So i have babel 7 installed, along with the plugin "#babel/plugin-proposal-object-rest-spread" included within my preset-env, however I'm still getting the following error as it hasn't transpiled my spread operators back into es2015.
SCRIPT1028: Expected identifier, string or number
I've tried referencing the plugin in the plugin array within my .babelrc file.
My .babelrc file:
{
"presets": [
"#babel/preset-react",
"#babel/preset-env", {
"include": [
"#babel/plugin-proposal-object-rest-spread"
]
}
],
"plugins": [
"#babel/plugin-syntax-dynamic-import",
"#babel/plugin-syntax-import-meta",
"#babel/plugin-proposal-class-properties",
"#babel/plugin-proposal-json-strings",
]
}
My package.json dependencies/dev dependencies:
"dependencies": {
"#babel/polyfill": "^7.2.5",
"axios": "^0.18.0",
"babel-polyfill": "^6.26.0",
"bootstrap": "^4.1.3",
"core-js": "^2.6.3",
"dotenv": "^6.1.0",
"get-base64": "^1.3.0",
"history": "^4.7.2",
"moment": "^2.22.2",
"prop-types": "^15.6.2",
"qs": "^6.5.2",
"react": "^16.6.0",
"react-debounce-input": "^3.2.0",
"react-dom": "^16.6.0",
"react-onclickoutside": "^6.7.1",
"react-redux": "^5.1.0",
"react-router-dom": "^4.3.1",
"react-router-redux": "^4.0.8",
"react-select": "^2.1.2",
"redux": "^4.0.1",
"redux-devtools-extension": "^2.13.5",
"redux-thunk": "^2.3.0",
"svg-url-loader": "^2.3.2",
"webpack": "^4.23.1",
"webpack-cli": "^3.1.2",
"webpack-dev-server": "^3.1.14",
"webpack-merge": "^4.1.4"
},
"devDependencies": {
"#babel/core": "^7.0.0",
"#babel/plugin-proposal-class-properties": "^7.0.0",
"#babel/plugin-proposal-json-strings": "^7.0.0",
"#babel/plugin-proposal-object-rest-spread": "^7.3.1",
"#babel/plugin-syntax-dynamic-import": "^7.0.0",
"#babel/plugin-syntax-import-meta": "^7.0.0",
"#babel/preset-env": "^7.0.0",
"#babel/preset-react": "^7.0.0",
"babel-eslint": "^9.0.0",
"babel-loader": "^8.0.0",
"babel-plugin-transform-es2015-destructuring": "^6.23.0",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"copy-webpack-plugin": "^4.6.0",
"css-loader": "^1.0.0",
"eslint": "^5.8.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jsx-a11y": "^6.1.2",
"eslint-plugin-react": "^7.11.1",
"file-loader": "^2.0.0",
"html-webpack-plugin": "^3.2.0",
"interpolate-html-plugin": "^3.0.0",
"node-sass": "^4.9.4",
"optimize-css-assets-webpack-plugin": "^5.0.1",
"sass-loader": "^7.1.0",
"style-loader": "^0.23.1",
"uglify-es-webpack-plugin": "^0.10.0",
"url-loader": "^1.1.2"
Looks like you're using Webpack, and you have babel-loader installed.
That being the case, here are two quick things to check:
Are you sure you're using that loader in your webpack config for js files?
rules: [
{
test: /\.jsx?$/,
loader: 'babel-loader',
exclude: /node_modules/,
},
],
Are there any js assets bypassing Webpack, "missing out" on that loader?
(Edit): And if "no" to those, might you also need "#babel/plugin-transform-spread" to capture spreads in an array, since "#babel/plugin-proposal-object-rest-spread" is object-specific?

Swiper ES module web.config for IE11 support

I am using swiper in a react app. In Internet Explorer 11 it pop up syntax error
(about arrow function since it is not supported by IE11)
I added the code suggested by the github repository but it doesn't work still getting syntax error on dom modular. Which use function arrow instead of been transformed into ES5. Anyone can help me correct this issue?
Syntax Error:
Object.key(Methods).forEach((methodName) => { WEBPACK_IMPORTED_MODULE_0_mod7_dist_dom7_modular...});
.babelrc:
{
"presets": [
"es2015",
"react"
]
}
webpack file part:
test: /\.js$/,
exclude: /(node_modules|bower_components|node_modules\/(?!(dom7|ssr-window|swiper)\/).*)/,
use: {
loader: 'babel-loader',
options: {
presets: ['env'],
},
},
},
package json
"dependencies": {
"#firebase/firestore": "^0.1.4",
"#google-cloud/bigquery": "^0.9.6",
"#google-cloud/pubsub": "^0.14.5",
"autoprefixer": "^6.6.1",
"axios": "^0.15.3",
"babel-cli": "^6.26.0",
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-polyfill": "^6.9.1",
"babel-preset-env": "^1.6.0",
"babel-preset-es2015": "^6.18.0",
"babel-preset-react": "^6.16.0",
"babel-preset-stage-0": "^6.16.0",
"babel-preset-stage-1": "^6.5.0",
"babel-register": "^6.26.0",
"classnames": "^2.2.5",
"cross-env": "^3.2.4",
"css-loader": "^0.28.5",
"cssnano": "^3.7.1",
"dotenv-webpack": "^1.5.4",
"es6-promise": "^3.2.1",
"firebase": "^4.6.2",
"firebase-admin": "5.4.1",
"firebase-functions": "0.7.1",
"firebase-tools": "^3.15.1",
"firebaseui": "2.3.0",
"glob": "^7.0.5",
"hashbuster": "^1.0.1",
"immutability-helper": "^2.1.1",
"json-loader": "^0.5.4",
"material-ui": "^0.20.0",
"minimist": "^1.2.0",
"node-geopoint": "^1.0.1",
"node-sass": "^4.5.3",
"normalize.css": "^5.0.0",
"postcss": "^5.0.21",
"postcss-flexbugs-fixes": "^2.0.0",
"postcss-load-config": "1.0.0",
"postcss-loader": "1.2.1",
"postcss-pxtorem": "^3.3.1",
"prop-types": "^15.6.0",
"pubsub-js": "^1.5.3",
"react": "^16.0.0",
"react-avatar-editor": "^10.3.0",
"react-css-modules": "^4.1.0",
"react-dom": "^16.0.0",
"react-geosuggest": "^2.6.0",
"react-google-maps": "^9.4.2",
"react-modal": "^3.1.6",
"react-onclickoutside": "^5.11.1",
"react-redux": "^5.0.2",
"react-router": "^3.0.2",
"react-router-redux": "^4.0.7",
"react-router-sitemap": "^1.1.3",
"react-scrollchor": "^4.0.0",
"react-svg-inline": "^2.0.0",
"react-times": "^2.2.8",
"redux": "^3.6.0",
"redux-thunk": "^2.2.0",
"resolve-url-loader": "^2.1.0",
"script-loader": "^0.7.0",
"slug": "^0.9.1",
"swiper": "^4.1.6"
},

Resources