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
I'm getting Uncaught ReferenceError: React is not defined when running the below code. I'm not sure why React is in the equation here. What am I missing about how this works?
Assuming this is the case. Vite uses esbuild to pre-build dependencies as an optimization. By default esbuild treats any JSX it encounters as React and converts it to React.createElement calls. Vite excludes dependencies it knows have JSX but only does so by looking at the extension of the entry file which doesn't work in this case. It does have a workaround though by manually excluding the library using the optimizeDeps.excludeconfig option.
I'm getting
Uncaught ReferenceError: React is not defined
when running the below code. I'm not sure why React is in the equation here. What am I missing about how this works?Versions:
Thanks!
The text was updated successfully, but these errors were encountered: