mswjs / is-node-process

Reliably determines if the code is running in Node.js. Treats Jest, React Native, Electron, and others like Node.js.

Home Page:https://npm.im/is-node-process

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No longer detecting Electron correctly.

Pagebakers opened this issue · comments

The node version is set in the latest Electron version.

process.versions.node

This causes the MSW workers fail to initialize.

Could check process.versions.v8 instead, the value is v8: "10.0.139.17-electron.0" on electron.

Seems like it only works when you keep the webpack target web instead of electron-renderer.