-
Notifications
You must be signed in to change notification settings - Fork 124
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
Legacy plugin not compatible with vite 2.7.x #156
Comments
Hi Stef! Thanks for providing a detailed report! I'll follow up with a comment in the pull request, thanks! |
The entry of the legacy-polyfill name has changed to start with a \u0000 character to mark it as a virtual entry in vite 2.7. This commit ensures that this new name is handled correctly. See: #156
Released |
Are we sure this isn't a regression/mistake in Vite? I see your link where the modules are prefaced with the ...but I'm not sure that's what is going on here, because that's |
Well I'm not a sure but when I started on fixing this issue in vite itself, I found that there was more code surrounding this and not just a simple typo. I created a fix within vite but I wasn't really sure on how to properly write a test / spec for this. If you look at the commit that introduced the character, it is also explicitly checked in the build step. But I agree with you that the difference between the So in short: I'm not sure but it works 😅 |
@khalwat I created a PR for my commit anyway at vite. Mainly to get the discussion going there ;) |
hmmmm you're right, this does look done on purpose: vitejs/vite@3127219 But I wonder if something isn't amiss with, however I'd think that this is what we should end up using: const polyfillId = '\0vite/legacy-polyfills' Rather than: \u0000vite/legacy-polyfills |
One thing to note from the API docs is that it says:
So this id prefixing is internal and should be undone before it is saved out to the |
bundle update vite_ruby
.Description 📖
In vite 2.7, the name of the legacy-polyfills entry has changed from
"../../vite/legacy-polyfills"
to"../../\u0000vite/legacy-polyfills"
. This filename has changed since this polyfill is a so called virtual file (as explained in the plugin api docs).This however makes the ruby code crash since it can't resolve the filename (see stacktrace below).
This change is also discussed in vitejs/vite#6097 but as I dove into it I found that this NULL character is not a typo but a feature. So therefore I think the gem should be change to handle this correctly.
If this could be confirmed as a bug, I could work out a solution.
Reproduction 🐞
vite_legacy_javascript_tag
orvite_legacy_typescript_tag
tagLogs 📜
Screenshots 📷
Provide console or browser screenshots of the problem.
The text was updated successfully, but these errors were encountered: