-
-
Notifications
You must be signed in to change notification settings - Fork 6.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build logs filled with warnings in 3.2.0 when relying on external (relative) assets #10766
Comments
Perhaps the build should fail if you haven't explicitly defined these resources as externals somewhere? In my case the externals are configured, as we don't just pull in resources in css files, but JS files too, and the build fails without externals configured. |
Encountered the same warning when testing at 3.2.4. |
I'm facing the same problem (3.2.4). Is there some way to fix these warnings? |
Same issue, due to this change in 3.2.0 - 9f268da |
Getting same error. In react app using semantic-ui-less. Worked in 3.1.8 |
Any news on this one? |
Any news? |
facing the same problem |
I'm having the same issue, is there a way to do this that I have missed? |
facing the same problem |
I'm having the same issue |
facing the same warnings |
Wanted to chip in with some additional info and an extra way to reproduce this. I'm running into it with two specific cases:
See my Stack Overflow question for full details, but the minimal repro I found:
For your convenience you can also clone my repository, run
|
During
after you execute But if Vite cannot resolve some of the resources, it will print this warning and leave the reference untouched.
Like These unresolved resources may be remote assets on the server, in @ScopeyNZ's case; while they may also be spelling mistakes like this case. In the former case, users are aware of what they are doing (unresolved resources are expected). Just ignore these warnings. But in the latter case, a warning like above can give some hints to users when they find their app is unexpectedly missing some assets. Anyway, Vite doesn't know, it'll print a warning message in case you need it. If your app performs well after build, you can simply ingore them. 😊 |
I think it would be nice to have an option to tell Vite to ignore them, rather than just having to trawl past dozens of error messages. In cases where you have something generating a stylesheet with hundreds of images, this causes significant bloat to build logs. |
My thoughts exactly and I'm willing to look into it. Considering the contribution guide here, it's not recommended to introduce another new option. I'll check if we can make use of the What do you suggest? @patak-dev |
Describe the bug
In my web app, I have many resources (images/fonts) that are hardcoded, but external resources (ie. the machine that builds my app won't have those resources).
After upgrading to 3.2.x, the build log is filled with messages like:
(Added in #10331)
The resources are defined in my vite.config file as externals (rollup config), although building the app doesn't actually care about this configuration for css files. Now, whether or not you define the externals in your rollup config, you just get a warning that you can't seem to suppress when you're referencing a resource that the builder doesn't have access to.
Reproduction
https://stackblitz.com/edit/vitejs-vite-u2wnpz?file=vite.config.js
Steps to reproduce
Just running
npm run build
in the example will show the warning. Uncommenting the externals config makes no difference - I'm not sure if it should.To reproduce from scratch, you just need to use
url('/[file]')
in any css file, referencing a resource that might be on your webserver, but not in your project.System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: