nuxt
nuxt copied to clipboard
Cannot read property toLowerCase of undefined
Hi all. this error comes up again
file package.json { "name": "texnomart-new", "version": "1.0.0", "private": true, "scripts": { "dev": "nuxt", "build": "nuxt build --modern=server", "dev:host": "nuxt --hostname '192.168.0.199' --port 8000", "start": "nuxt start --modern=server", "generate": "nuxt generate", "lint:prettier": "prettier --check .", "lint": "npm run lint:prettier", "lintfix": "prettier --write --list-different ." }, "dependencies": { "@nuxtjs/auth-next": "5.0.0-1622918202.e815752", "@nuxtjs/axios": "^5.13.6", "@nuxtjs/dotenv": "^1.4.1", "@nuxtjs/google-analytics": "^2.4.0", "@nuxtjs/google-fonts": "^3.0.0-0", "@nuxtjs/i18n": "^7.2.0", "@nuxtjs/pwa": "^3.3.5", "@nuxtjs/redirect-module": "^0.3.1", "@nuxtjs/yandex-metrika": "^1.3.0", "@pinia/nuxt": "^0.1.8", "core-js": "^3.15.1", "epic-spinners": "^1.1.0", "fs": "0.0.1-security", "nuxt": "^2.15.7", "nuxt-lazy-load": "^1.2.9", "nuxt-ssr-cache": "^1.5.2", "nuxt-start": "^2.15.8", "path": "^0.12.7", "swiper": "^5.4.5", "v-mask": "^2.3.0", "vue-ads-pagination": "^2.1.7", "vue-awesome-swiper": "^4.1.1", "vue-lazy-hydration": "^2.0.0-beta.4", "vue-multiselect": "^2.1.6", "vue-server-renderer": "^2.6.14", "vue-slider-component": "^3.2.15", "vue-template-compiler": "^2.6.14", "vue-typer": "^1.2.0", "vue-yandex-maps": "^0.11.8", "vue2-datepicker": "^3.10.4", "vuejs-datepicker": "^1.6.2", "vuelidate": "^0.7.7", "vuex-persistedstate": "^4.1.0" }, "devDependencies": { "@aceforth/nuxt-optimized-images": "^1.4.0", "@lhci/cli": "^0.9.0", "@nuxt/image": "^0.6.2", "@nuxt/types": "~2.15.0", "@nuxtjs/style-resources": "^1.2.1", "eslint-config-prettier": "^8.3.0", "node-sass": "^6.0.1", "nuxt-compress": "^5.0.0", "nuxt-vite": "^0.3.5", "prettier": "2.6.1", "sass": "^1.43.4", "sass-loader": "^10.2.0", "webpack-bundle-analyzer": "^4.5.0" } }
file nuxt.config.js export default { server: { port: 8000, host: '0.0.0.0', },
target: 'server',
ssr: true,
globalName: 'texnomart',
reactiveLoading: true,
components: false,
head: {
title: 'Texnomart',
meta: [
{ charset: 'utf-8' },
{
name: 'viewport',
content: 'width=device-width, initial-scale=1',
},
{ name: 'format-detection', content: 'telephone=no' },
{ name: 'theme-color', content: '#fbc100' },
{ name: 'msapplication-navbutton-color', content: '#fbc100' },
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: 'favicon.ico' },
// start pwa
{
rel: 'apple-touch-icon',
href: './assets/img/appleTouchIcon.png',
},
{
rel: 'preconnect',
href: 'https://fonts.gstatic.com',
},
],
},
loading: false,
// loading: '@/components/Loading.vue',
// Global CSS: https://go.nuxtjs.dev/config-css
css: ['swiper/css/swiper.css', '@/assets/styles/main.scss'],
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
plugins: [
{ src: '@/plugins/axios.js' },
{ src: '@/plugins/vuelidate.js', ssr: true },
{ src: '@/plugins/v-mask.js', ssr: true },
{ src: '@/plugins/vuex-persistedstate.js', ssr: false },
{ src: '@/plugins/main.js' },
{ src: '@/plugins/vue-swiper.js' },
{ src: '@/plugins/yandex-map.js' },
],
// Auto import components: https://go.nuxtjs.dev/config-components
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
buildModules: [
'@nuxtjs/pwa',
'@nuxtjs/style-resources',
'@nuxtjs/google-analytics',
],
styleResources: {
scss: ['@/assets/styles/_variables.scss'],
},
// Modules: https://go.nuxtjs.dev/config-modules
modules: [
// https://go.nuxtjs.dev/axios
'@nuxtjs/axios',
'@nuxtjs/i18n',
'@nuxtjs/auth-next',
'nuxt-ssr-cache',
'@nuxtjs/dotenv',
],
pwa: {
manifest: {
name: 'Texnomart',
lang: 'en',
background_color: '#fbc100',
theme_color: '#fbc100',
},
icon: {
fileName: 'icon.png',
targetDir: 'static',
// source: './static',
},
},
auth: {
redirect: false,
strategies: {
phone: {
scheme: 'local',
token: {
property: 'data.token',
type: '',
name: 'token',
},
user: {
property: 'data',
// autoFetch: true
},
endpoints: {
login: {
url: 'api/v2/user/login-phone-verify',
method: 'post',
},
user: {
url: 'api/v1/profile/info',
method: 'post',
},
logout: false,
},
},
register: {
scheme: 'local',
token: {
property: 'data.token',
type: '',
name: 'token',
},
user: {
property: 'data',
// autoFetch: true
},
endpoints: {
login: { url: 'api/v1/user/verify-code', method: 'post' },
user: { url: 'api/v1/profile/info', method: 'post' },
logout: false,
},
},
},
},
axios: {
baseURL: process.env.baseURL,
},
router: {
prefetchLinks: false,
},
cache: {
useHostPrefix: false,
pages: ['/'],
store: {
type: 'memory',
max: 30,
ttl: 900,
},
},
}
for a solution, I tried to wrap this page with tags