I know the react template is not a priority and it's probably specific to react but just in case.
I'm trying this out with typescript and the react template and was setting up styled-components and I got this error in the console of chrome.
Uncaught SyntaxError: The requested module '/@modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js' does not provide an export named 'default'
yarn
yarn dev
vite version: vite v0.14.3Vite by default expects all dependencies to ship ES modules, in this case, the dependency in question is using cjs syntax.
What you can do for now is use Snowpack (1.x) alongside Vite - yarn add -D snowpack then run a script of snowpack install to pre-bundle styled-components into a single ESM file. Vite will provide built-in support for this soon.
Most helpful comment
Vite by default expects all dependencies to ship ES modules, in this case, the dependency in question is using cjs syntax.
What you can do for now is use Snowpack (1.x) alongside Vite -
yarn add -D snowpackthen run a script ofsnowpack installto pre-bundlestyled-componentsinto a single ESM file. Vite will provide built-in support for this soon.