JohnPremKumar / vite-plugin-favicons-inject

A Vite plugin for creating and injecting favicons during the application build!
MIT License
10 stars 3 forks source link

Linux error during build NO_FILES_FOUND #11

Closed gaetandezeiraud closed 1 year ago

gaetandezeiraud commented 1 year ago

This error occur when I try to build the ViteJS project on the server (on Ubuntu server).

[vite-plugin-favicon-inject] NO_FILES_FOUND
error during build:
Error: NO_FILES_FOUND
    at Object.closeBundle (/var/www/html/premo-front/node_modules/vite-plugin-favicons-inject/dist/cjs/index.js:94:15)
    at file:///var/www/html/premo-front/node_modules/vite/node_modules/rollup/dist/es/shared/rollup.js:23704:40
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Promise.all (index 0)
    at async PluginDriver.hookParallel (file:///var/www/html/premo-front/node_modules/vite/node_modules/rollup/dist/es/shared/rollup.js:23632:9)
    at async file:///var/www/html/premo-front/node_modules/vite/node_modules/rollup/dist/es/shared/rollup.js:24919:13
    at async catchUnfinishedHookActions (file:///var/www/html/premo-front/node_modules/vite/node_modules/rollup/dist/es/shared/rollup.js:24066:20)
    at async rollupInternal (file:///var/www/html/premo-front/node_modules/vite/node_modules/rollup/dist/es/shared/rollup.js:24906:5)
    at async doBuild (file:///var/www/html/premo-front/node_modules/vite/dist/node/chunks/dep-5e7f419b.js:44508:24)
    at async build (file:///var/www/html/premo-front/node_modules/vite/dist/node/chunks/dep-5e7f419b.js:44347:16)
error Command failed with exit code 1.

With this configuration : vitePluginFaviconsInject('./src/assets/favicon.png'),. The favicon file is correct.

gaetandezeiraud commented 1 year ago

But no error on Windows.

MetaMmodern commented 1 year ago

@Brouilles why did you close this? I get the same error now in CI/CD. Wasn't happening before.

And doesn't happen locally on MacOS

MetaMmodern commented 1 year ago

@JohnPremKumar I would suggest you to reopen this issue and investigate, because it looks like issue is not in your plugin. My case was that I renamed a .js file by changing the casing (for instance it was file.js and I made File.js). And Linux+Git don't understand that, so they were throwing an error. But instead of seing the actual error we see an error from your plugin.

The same, btw, happened just now when I wrote my vite config with a mistake. Instead of showing the source of the mistake with error it was showing error in your plugin.

So the problem is that for some reason your plugin catches all the errors during build and drops them, while showing it's own error.

For anyone who finds himself in this situation just comment out this plugin and you'll see the actual error.

JohnPremKumar commented 1 year ago

Sure, I will look into the issue that you mentioned. But opening the current issue for tracking it would be out of context since there are actually other cases where this particular issue will be happen. May be open a new issue for tracking this behaviour.

rtkirill commented 1 year ago

Any way how to fix it? I got the same error on my Ubuntu server.

rtkirill commented 1 year ago

The problem wasn't with this plugin, however, this plugin catches all app errors, and in error logs it shows the plugin error "NO_FILES_FOUND".

I guess it should be fixed to don't catch all errors, only plugin errors. Thanks!

JohnPremKumar commented 1 year ago

Yes, will fix it soon

shipurjan commented 1 year ago

I still have this error

vite v4.4.9 building for production...
transforming...
✓ 20 modules transformed.
✓ built in 3.88s
[vite-plugin-favicon-inject] NO_FILES_FOUND
error during build:
Error: NO_FILES_FOUND
    at Object.closeBundle (/buddy/buddy-smart-light-blinds-frontend/node_modules/vite-plugin-favicons-inject/dist/cjs/index.js:94:15)
    at file:///buddy/buddy-smart-light-blinds-frontend/node_modules/rollup/dist/es/shared/node-entry.js:25356:40
    at async Promise.all (index 0)
    at async PluginDriver.hookParallel (file:///buddy/buddy-smart-light-blinds-frontend/node_modules/rollup/dist/es/shared/node-entry.js:25284:9)
    at async file:///buddy/buddy-smart-light-blinds-frontend/node_modules/rollup/dist/es/shared/node-entry.js:26518:13
    at async catchUnfinishedHookActions (file:///buddy/buddy-smart-light-blinds-frontend/node_modules/rollup/dist/es/shared/node-entry.js:25722:16)
    at async rollupInternal (file:///buddy/buddy-smart-light-blinds-frontend/node_modules/rollup/dist/es/shared/node-entry.js:26505:5)
    at async build (file:///buddy/buddy-smart-light-blinds-frontend/node_modules/vite/dist/node/chunks/dep-df561101.js:48005:18)
    at async CAC.<anonymous> (file:///buddy/buddy-smart-light-blinds-frontend/node_modules/vite/dist/node/cli.js:822:9)

On

PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm

It builds fine on MacOS, but doesn't work on CI/CD