Dist files not generating after npm run build command

I’m having trouble with my npm build process. It used to work fine but now it’s not creating the dist files anymore. When I run npm run build, I get a message saying the build is complete, yet the files do not appear in the dist directory.

I tried reverting to my previous commit, but the issue persists. I also executed npm run build --verbose to get more detailed output. The logs indicate that the build process completes successfully, but the generated files are missing.

I searched online for solutions and even modified the assetsPublicPath in my config/index.js file from ‘/’ to ‘./’, but nothing changed. Has anyone encountered this issue before? Any advice on how to resolve it would be appreciated. Thank you!

I’ve encountered this issue before. One thing to check is your webpack configuration. Make sure the output path is correctly set to the ‘dist’ directory. Also, verify that you have sufficient permissions to write to that directory.

Another potential cause could be an antivirus program interfering with the file creation process. Try temporarily disabling your antivirus and run the build again.

If none of these work, you might want to create a minimal reproduction of your project and share it on GitHub. This would allow others to more easily diagnose the problem. Sometimes, it’s a subtle configuration issue that’s not immediately apparent.

mate, i had a similar issue. check ur .gitignore file - maybe ur accidentally ignoring the dist folder? Also, try clearing ur npm cache (npm cache clean --force) and reinstalling dependencies. if that doesnt work, double-check ur build script in package.json. sometimes a typo can mess things up. good luck!

I’ve dealt with this frustrating issue before. One thing that worked for me was clearing the Node.js cache. Try running npm cache clean --force followed by npm rebuild. This can sometimes resolve weird build problems.

Another potential fix is to check your Node.js version. I once had a similar problem when my Node version was incompatible with some of my dependencies. Try updating Node to the latest LTS version and see if that helps.

If those don’t work, you might want to look at your webpack config. Sometimes, the output path can get messed up, especially if you’ve recently changed your project structure. Double-check that the path is correct and absolute.

Lastly, if you’re using any build plugins, try disabling them one by one to isolate the issue. I’ve had cases where a plugin was silently failing and preventing the dist files from being generated.

Hope one of these suggestions helps you out!