"Vite manifest not found at manifest.json" — Automating "npm run dev" in PHPStorm.
How many times have you seen this error message?
If you're like most developers, it's likely every time you open your browser and visit the local version of your website. But why does it appear so frequently? There are several possible reasons, but the most common one is often the simplest: you may have forgotten to run the compiling command.
$ npm run dev
Running this command starts the development server, compiles your assets, and watches for any changes in your code. However, the focus of this article is to save you the hassle of running the command every time you want to visit your website locally. So, automate the process. 😀
Adding a New Configuration:
First, open PHPStorm. And from the top menu bar, navigate to Run > Edit Configurations.
Click on it to open the Run/Debug Configurations window.
Next, click the plus button (+) to add a new configuration. A list of available configurations will appear. Scroll down and select npm.
On the new window, in the Command field, type run, and in the Scripts field, type dev.
Recommended by LinkedIn
If you prefer not to have the tool window open each time you run this configuration, uncheck the Activate tool window option at the bottom. Once done, click OK to save the configuration.
Automating the Process:
Now that the configuration is in place, we only need to tell PHPStorm to run it automatically each time we open the project.
It's simple: go to Settings. In the top search bar, type startup, and select Startup Tasks. Next, click on the plus button (+) and then select Add New Configuration.
You’ll see the same list as before. Choose npm then select the dev configuration we just added which is nested under npm.
Congratulations. You're done. Now, you'll never see that error message again.
Software engineer | Front-end developer | React js | Next js | vue js
6moVery informative
Software Engineer - Fullstack Laravel & Vue developer
6moThanks for providing an article on this, now I can send it whenever I want to tell someone to do it as I do that in pair programming sessions