-
-
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
optimizeDeps.exclude
removes default
property from exports
#10258
Labels
feat: deps optimizer
Esbuild Dependencies Optimization
p3-minor-bug
An edge case that only affects very specific usage (priority)
Comments
sapphi-red
added
the
p3-minor-bug
An edge case that only affects very specific usage (priority)
label
Oct 10, 2022
sapphi-red
added
pending triage
feat: deps optimizer
Esbuild Dependencies Optimization
labels
Oct 10, 2022
sapphi-red
added a commit
to sapphi-red/vite
that referenced
this issue
Oct 10, 2022
9 tasks
sapphi-red
added a commit
to sapphi-red/vite
that referenced
this issue
Nov 9, 2022
patak-dev
pushed a commit
that referenced
this issue
Nov 24, 2022
futurGH
pushed a commit
to futurGH/vite
that referenced
this issue
Feb 26, 2023
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
feat: deps optimizer
Esbuild Dependencies Optimization
p3-minor-bug
An edge case that only affects very specific usage (priority)
Describe the bug
When a dependency is added in
optimizeDeps.exclude
, it injects__reExport
during dependency pre-bundling (link) which removesdefault
property.Steps to reproduce:
node_modules/
directory.react
fromoptimizeDeps
.react
imports as external and replaces them with external ESM URLs.node_modules/.vite/deps
for a chunk file that contains// external:react
. It has the following code snippet:__reExport
removesdefault
property from react import:src/index.tsx
. Refresh the webpage, it loads the UI without error.optimizeDeps
and plugin implementation from vite config. Refresh the webpage, it loads the UI without error.theming.esm.js
is trying to accessReact.Component
but it isundefined
becausereact_exports
does not contain"default"
property.Reproduction
https://stackblitz.com/edit/vitejs-vite-u5bre3
System Info
Used Package Manager
npm
Logs
Console Error:
Validations
The text was updated successfully, but these errors were encountered: