#Laravel Mix to Vite

1 messages · Page 1 of 1 (latest)

glacial heart
#

I am currently upgrading to use Vite in our internal system. I followed the document here https://laravel.com/docs/9.x/vite

It is working fine with npm run dev

But building npm run build, is throwing an error in terminal


> build
> vite build

error during build:
RangeError: Maximum call stack size exceeded
    at String.match (<anonymous>)
    at _interpolate (/Users/rex/Development/connector-dashboard/node_modules/vite/dist/node-cjs/publicUtils.cjs:4140:28)
    at /Users/rex/Development/connector-dashboard/node_modules/vite/dist/node-cjs/publicUtils.cjs:4176:15
    at Array.reduce (<anonymous>)
    at _interpolate (/Users/rex/Development/connector-dashboard/node_modules/vite/dist/node-cjs/publicUtils.cjs:4142:18)
    at /Users/rex/Development/connector-dashboard/node_modules/vite/dist/node-cjs/publicUtils.cjs:4176:15
    at Array.reduce (<anonymous>)
    at _interpolate (/Users/rex/Development/connector-dashboard/node_modules/vite/dist/node-cjs/publicUtils.cjs:4142:18)
    at /Users/rex/Development/connector-dashboard/node_modules/vite/dist/node-cjs/publicUtils.cjs:4176:15
    at Array.reduce (<anonymous>)

I checked the code in publicUtils.cjs at _interpolate() function, from what I understand it is for env variables?

Can you help me resolve this please.

Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.

#

npm version 9.5.1
node version v18.16.0
currently in Laravel 9

    "private": true,
    "scripts": {
        "dev": "vite",
        "build": "vite build",
        "preview": "vite preview"
    },
    "devDependencies": {
        "@vitejs/plugin-vue": "^4.2.3",
        "@vue/compiler-sfc": "^3.1.0",
        "autoprefixer": "^10.4.13",
        "axios": "^0.21",
        "cross-env": "^7.0",
        "jquery": "^3.6",
        "laravel-vite-plugin": "^0.7.8",
        "postcss": "^8.4.21",
        "resolve-url-loader": "^4.0.0",
        "sass": "1.32.13",
        "sass-loader": "^12.1.0",
        "tailwindcss": "^3.2.6",
        "vite": "^4.3.9",
        "vue-loader": "^16.0.0"
    },
    "dependencies": {
        "@vuelidate/core": "^2.0.2",
        "@vuelidate/validators": "^2.0.2",
        "apexcharts": "^3.27.2",
        "chart.js": "^4.2.1",
        "pinia": "^2.0.28",
        "primeflex": "^3.3.0",
        "primeicons": "^6.0.1",
        "primevue": "^3.29.2",
        "vue": "^3.1.0",
        "vue-apexcharts": "^1.6.1",
        "vue-router": "^4.0.0"
    }
}