Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

leonvr's avatar

Error moving from Mix to Vite

I try to switch from Mix to Vite, but now on I get the following error:

PS C:\laragon\www\vll4j> npm run build

> build
> vite build

vite v4.0.4 building for production...
transforming (19) node_modules\axios\package.json
A PostCSS plugin did not pass the `from` option to `postcss.parse`. This may cause imported assets to be incorrectly transformed. If you've recently added a PostCSS plugin that raised this warning, please contact the package author to fix the issue.
✓ 52 modules transformed.
public/build/manifest.json              0.26 kB
public/build/assets/app-5041e329.css   54.77 kB │ gzip:  9.43 kB
public/build/assets/app-fa30bb31.js   135.22 kB │ gzip: 50.66 kB
PS C:\laragon\www\vll4j>

Everything seems to be fine at first sight, but I would like to get rid of 'PostCSS'-error. Maybe it got something to do with this remark from the upgrade guide:

If you are using other PostCSS plugins, such as postcss-import, you will need to include them in your configuration. https://github.com/laravel/vite-plugin/blob/main/UPGRADE.md#optional-configure-tailwind

I added the first plugin to my postcss.config.js but it does not make a difference. The outcome is either way the same.

module.exports = {
  plugins: {
    'postcss-import': {},
    tailwindcss: {},
    autoprefixer: {},
  },
}

I hope someone can help me out, because I don't know what to do. Let me know if you need more info.

0 likes
10 replies
thinkverse's avatar

What version of the packages are you using? Is this warning reproducible if you don't migrate from Mix to Vite and use Vite from the beginning, like a new Laravel app with the same packages?

leonvr's avatar

@thinkverse Hi, like you suggested I started a new Laravel app. The error-message does not appear. It does also not appear after I transformed the following files to be the same as my existing app:

But still I get the same error.

thinkverse's avatar

@leonvr could be your application has older versions of the packages installed. You can check which versions are installed in each application using the npm ls command, then compare and see if the versions match or not. The warning was most likely fixed in a minor release.

leonvr's avatar

@thinkverse I deleted my node_modules folder and executed npm install. Still my versions remain slightly older than the versions of the new project (the version of axios is the same though). I do not understand how this can differ because the contents of package.json are identical for both projects.

PS C:\laragon\www\vll4j> npm ls
vll4j@ C:\laragon\www\vll4j
├── @tailwindcss/[email protected]
├── @tailwindcss/[email protected]
├── @tailwindcss/[email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]
leonvr's avatar

@Sinnbeck @thinkverse Yes! after npm update the versions are the same as the new project (how come deleting the node_modules folder and then npm install does not install the latest possible versions?). Also the error message is now gone! Thank you both!

PS C:\laragon\www\vll4j> npm update

added 6 packages, removed 56 packages, changed 44 packages, and audited 114 packages in 55s

21 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
PS C:\laragon\www\vll4j> npm ls
vll4j@ C:\laragon\www\vll4j
├── @tailwindcss/[email protected]
├── @tailwindcss/[email protected]
├── @tailwindcss/[email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]

PS C:\laragon\www\vll4j> npm run build

> build
> vite build

vite v4.0.4 building for production...
✓ 52 modules transformed.
public/build/manifest.json              0.26 kB
public/build/assets/app-acce09d5.css   55.78 kB │ gzip:  9.52 kB
public/build/assets/app-8380aa93.js   131.27 kB │ gzip: 48.22 kB
PS C:\laragon\www\vll4j>
Sinnbeck's avatar

@leonvr because they are controlled by package.lock. That file tell the exact versions

Please or to participate in this conversation.