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 am unsure if this is an issue with Vite or yarn, so I'm posting the issue on both.
When using yarn berry in pnp mode, Vite fails to properly load the package.json browser field from engine.io-client. This results in browser polyfills not loading.
To Reproduce
Initialize a new yarn berry repo
yarn create @vitejs/app
Select preset vue-ts
cd into project
yarn add engine.io-client
In src/main.ts add the following lines import client from 'socket.io-client'; client
yarn dev
Load the site in the browser and open the console. You will see an error from socket.io-client being bundled with the non browser package substitutions.
If you add nodeLinker: node-modules to the .yarnrc.yml file, the browser field detection works properly any you will not see errors.
Additional context
vite version: 2.0.0-beta.67
Operating System: Pop!_OS 20.04
Node version: 14.15.4
Package manager (npm/yarn/pnpm) and version: yarn 2.4.0
The text was updated successfully, but these errors were encountered:
Describe the bug
I am unsure if this is an issue with
Vite
oryarn
, so I'm posting the issue on both.When using
yarn berry
inpnp
mode, Vite fails to properly load the package.jsonbrowser
field fromengine.io-client
. This results in browser polyfills not loading.To Reproduce
yarn create @vitejs/app
vue-ts
cd
into projectyarn add engine.io-client
src/main.ts
add the following linesimport client from 'socket.io-client'; client
yarn dev
Load the site in the browser and open the console. You will see an error from socket.io-client being bundled with the non
browser
package substitutions.If you add
nodeLinker: node-modules
to the.yarnrc.yml
file, the browser field detection works properly any you will not see errors.Additional context
vite
version:2.0.0-beta.67
yarn 2.4.0
The text was updated successfully, but these errors were encountered: