-
-
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
(Vite 5): breaking import.meta.glob
API needs corrections
#15939
Comments
(Critical Bug): It is worth noting that there is a difference between the In dev mode, it is working as expected. |
To keep a consistent track, I found the related PR #14420. |
It comes to my attention that:
is caused not by the It seems we have a new feature that assets may be inlined, but this causes the build to produce incompatible assets especially when the code references an asset's URL as the case I mentioned. At that point, the produced object (during build) by
instead of:
As a workaround, disabling the inlining process by setting assetsInlineLimit: 0 in Vite configs (build). |
For this, in the latest version, I see it has been marked as deprecated. However, it is still used for inferring! How do rely on something deprecated? The next reply discusses the inferring type for return. |
This one is still not resolved yet.
It is just a pseudo-code for clarification. |
As to make a stable base for long-term maintenance (even if it is minor), IMO, all queries should be known types such as |
Remaining one bug related here: |
Can you summarize the issue here? We are not removing the |
Sure.
That's all. |
Describe the bug
There should be tight alignments while breaking the
import.meta.glob
API.This bug report discusses the second parameter, the
options
argument.as
should be removed from the types/interfaces while it has been removed from the docs.eager
andas
. This is impossible while nothing is calledas
in the new interface! Noting that the inferring can now (if there won't be generics) rely oneager
,query
, ANDimport
.as
byquery
. This is not clear in the docs. Also, it is worth noting that the question mark?
prefix became mandatory forraw
,url
, andinit
.Proposed Actions
as
option.options
interface to be not acceptingas
anymore (static-type).Either way, there should be:
?
is mandatory now for the built-in supported types (mentioned above), support both with?
or without, or support only without?
and the mark would be injected automatically if the process needs it.import
option, if there is no intent to introduce generics here.Reproduction
generic
Steps to reproduce
No response
System Info
Used Package Manager
pnpm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: