You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A function in a nested require is not correctly processed.
sodatea said on discord:
A small bug in Vite's resolution algorithm.
There's a module field in callbag-from-event, while callbag-for-each only has main.
https://unpkg.com/browse/callbag-from-event@1.3.0/package.json#L10
module has higher precedence in Vite than main.
https://github.com/vitejs/vite/blob/a74bd7ba9947be193bccf636b8918bd1f59e89ae/packages/vite/src/node/plugins/resolve.ts#L778-L786
The fix is similar to #7438 that module or jsnext fields should be skipped when it's initiated by a require call.
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/core instead.
@SteveALee re-opening as we needed to revert #7582, see #7737 for more context. I discussed with @sodatea and he has an idea for another fix, but it may require a new option so it will probably take a bit more time to get this one fixed.
Describe the bug
A function in a nested require is not correctly processed.
sodatea said on discord:
Reproduction
See https://stackblitz.com/edit/vitejs-vite-wthjcb?file=main.js
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: