"ReferenceError: Can't find variable: globalThis" @vitejs/plugin-legacy in Safari 11 #11645
Closed
7 tasks done
Labels
duplicate
This issue or pull request already exists
Describe the bug
Hi! I'm trying to build a simple react-ts app which consumes @chakra-ui/react for legacy browsers, and in testing Safari 11 I'm getting a blank page and the console error:
Because Safari 11 supports modules, it gets the module bundle, no polyfills. If I hack dist/index.html to remove the
<script modules .../>
completely (and thenomodules
sttr on legacy bundles) and have it load the legacy bundles, then page renders fine in Safari 11.Is there a way of causing Safari 11 to use legacy bundles? Tx!
Reproduction
https://stackblitz.com/edit/vitejs-vite-9grdsk?file=vite.config.js,src%2Fmain.jsx,src%2FApp.jsx&terminal=dev
Steps to reproduce
npm run build && npm run preview -- --host
System Info
Used Package Manager
npm
Logs
ReferenceError: Can't find variable: globalThis
Sorry - can't copy text out of the browserstack console! (note that the error is raise in the module bundle)
Validations
The text was updated successfully, but these errors were encountered: