I am trying to make the nuxt-i18n work for IE document mode 11.
SCRIPT1006: Expected ')'
I have seen from this link that nuxt-i18n fixed the issue in 6.23.0 version related to a script error , https://github.com/nuxt-modules/i18n/issues/329
but still encountering the same error with my following code
package.json
{
"name": "t",
"version": "1.0.1",
"description": "t",
"author": "t t",
"private": true,
"scripts": {
"dev": "nuxt",
"build": "nuxt build",
"start": "nuxt start",
"test": "jest -u - runInBand - coverage - passWithNoTests",
"generate": "nuxt generate",
"lint": "eslint - ext .js,.vue - ignore-path .gitignore .",
"lint:fix": "eslint - fix - ext .js,.vue - ignore-path .gitignore .",
"lint:css": "stylelint - fix ./**/*.{vue,scss,css}"
},
"lint-staged": {
"*.{js,vue}": "npm run lint:fix",
"*.{css,vue}": "npm run lint:css"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"dependencies": {
"@babel/compat-data": "7.19.4",
"@babel/core": "7.21.3",
"@babel/generator": "7.19.6",
"@babel/helper-compilation-targets": "7.19.3",
"@babel/helper-create-class-features-plugin": "7.19.0",
"@babel/helper-module-transforms": "7.19.6",
"@babel/preset-env": "7.12.17",
"@nuxtjs/axios": "5.12.2",
"@nuxtjs/dotenv": "1.4.0",
"@nuxtjs/proxy": "2.0.1",
"@nuxtjs/pwa": "3.0.0–0",
"@nuxtjs/vuetify": "1.11.3",
"axios": "0.21.0",
"babel-polyfill": "6.26.0",
"bootstrap-vue": "2.21.2",
"cookie-universal-nuxt": "2.1.4",
"json5": "2.2.1",
"jsonwebtoken": "8.5.1",
"lodash": "4.17.20",
"moment": "2.29.1",
"nuxt": "2.12.2",
"nuxt-i18n": "6.27.0",
"vue-jest": "3.0.7",
"vuex-persist": "3.1.3",
"@babel/plugin-transform-runtime": "7.21.4",
"core-js": "2.6.12"
},
"devDependencies": {
"@nuxtjs/eslint-config": "2.0.0",
"@nuxtjs/eslint-module": "1.0.0",
"@nuxtjs/stylelint-module": "3.1.0",
"babel-eslint": "10.0.1",
"node-sass": "6.0.1",
"sass-loader": "10.3.1",
"stylelint": "10.1.0",
"stylelint-config-standard": "20.0.0"
},
"config": {
"nuxt": {
"host": "0.0.0.0"
}
},
"engines": {
"node": "16.x"
}
}
and my nuxt config
require('babel-polyfill')
import i18n from './config/i18n'
const features = [
'fetch',
'Object.entries',
'es2015',
'es5',
'es6',
'IntersectionObserver',
'Object.defineProperty'
].join('%2C');
export default {
mode: 'universal',
// env:{
// VUE_APP_APIURL1: process.env.VUE_APP_APIURL1 || 'null'
// },
publicRuntimeConfig: {
myPublicVariable: process.env.VUE_APP_APIURL1 || 'test',
},
head: {
title: process.env.npm_package_name || '',
meta: [{
charset: 'utf-8'
},
{
'http-equiv': 'X-UA-Compatible',
content: 'IE=Edge'
},
{
name: 'viewport',
content: 'width=device-width, initial-scale=1'
},
{
hid: 'description',
name: 'description',
content: process.env.npm_package_description || ''
}
],
link: [{
rel: 'icon',
type: 'image/x-icon',
href: '/favicon.ico'
}],
script: [{
src: `https://polyfill.io/v3/polyfill.min.js?features=${features}`,
body: true
},
{
src: 'https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/6.23.0/polyfill.min.js'
}
]
},
/*
** Customize the progress-bar color
*/
loading: {
color: '#fff'
},
/*
** Global CSS
*/
css: [],
/*
** Plugins to load before mounting the App
*/
plugins: [
'~/plugins/env.js'
],
/*
** Nuxt.js dev-modules
*/
buildModules: [
'@nuxtjs/vuetify',
'@nuxtjs/dotenv',
['nuxt-i18n',
{
vueI18nLoader: true,
defaultLocale: 'en',
locales: [{
code: 'en',
name: 'English'
},
{
code: 'fr',
name: 'Français'
}
],
vueI18n: i18n
}
]
// Doc: https://github.com/nuxt-community/eslint-module
// '@nuxtjs/eslint-module',
// Doc: https://github.com/nuxt-community/stylelint-module
// '@nuxtjs/stylelint-module'
],
/*
** Nuxt.js modules
*/
modules: [
'@nuxtjs/pwa',
'@nuxtjs/axios',
'@nuxtjs/proxy',
// Doc: https://github.com/nuxt-community/dotenv-module
'cookie-universal-nuxt',
'bootstrap-vue/nuxt'
],
bootstrapVue: {
components: ['BTabs', 'BTab']
},
axios: {
proxyHeaders: true,
init(axios, ctx) {
axios.defaults.headers.post['Content-Type'] = 'application/json;'
}
},
/*
** Build configuration
*/
build: {
babel: {
"presets": [
[
"@babel/preset-env",
{
"useBuiltIns": "usage",
"corejs": "2.6.12"
},
],
],
"plugins": [
"@babel/plugin-transform-runtime"
],
},
postcss: null,
transpile: [],
vendor: ['axios'],
/*
** You can extend webpack config here
*/
}
};
i18n.js
import en from '../locales/en.json'
import fr from '../locales/fr.json'
export default {
locale: 'en',
fallbackLocale: 'en',
messages: { en, fr }
}
Is anyone faced the same issue before and knows how to resolve it?
created issue too https://github.com/nuxt-modules/i18n/issues/2041
Also tried adding @babel/plugin-transform-parameters in the plugins array of babel as it looks like issue with default parameters but no luck yet
"plugins": [
"@babel/plugin-transform-runtime", [@babel/plugin-transform-parameters,{"loose":true}]
],