-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Vite4 regression - TypeError: Cannot read properties of undefined #11299
Comments
This is happening because Vite 4 now correctly resolves the
Closing as this is not a bug in Vite. |
@sapphi-red I just started getting the ES module warning after bumping to the latest Sveltekit which depends on Vite 4, but there's no indication about which package is causing the warning. How can I track down the relevant package?
|
@fredguest I think using |
I've tried adding So far none of that changes the output of the warning at all. Is there another trick I'm missing? Does the |
Why did you decide to stop supporting these incorrect package.json exports? There are so many incorrectly configured packages out there, I think migration will be hard. |
@fredguest Umm, then, I don't have any idea other than trimming imports manually. @nitedani What we did is not stop supporting incorrect package.json exports. That was never working with Vite. What we changed is that we stopped trying to use CJS files in any cases (#11101). |
@sapphi-red ok cool no worries, thanks for the help anyway. Ya I was trying to avoid manual process of elimination but it looks like the only option. I'm sure many people will start hitting that indirect ES Module waring at compile time so if there's anyway to pass a more direct warning through Vite it might be worth implementing. |
I think this should be considered as a bug in Vite. It stopped working because of a change in Vite. I think #11101 should be revisited. |
this is a comment from another user on a thread that is referenced above, not sure if its worth adding here: "It seems the fix is in this PR comment.." |
i see, i have a same problem for my own project ssr-setup |
Describe the bug
The only change was going from vite 3 > vite 4. It was working with vite 3 and even vite 2.
The following code throws an error on the server in development:
Reproduction
https://stackblitz.com/github/nitedani/vite4-bug123
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: