cerebral / overmind

Overmind - Frictionless state management
https://overmindjs.org
MIT License
1.58k stars 95 forks source link

Alter test for process #495

Closed eirikhm closed 3 years ago

eirikhm commented 3 years ago

Vite/rollup does not shim global, process etc which are not available in a browser (https://github.com/vitejs/vite/issues/1689). This results in the blocking error 'process is not defined' since the variable does not exist.

The current check for isNode look like this: const isNode = !IS_TEST && process && process.title && process.title.includes('node')

Altering this as follows ensures this is handled properly: const isNode = !IS_TEST && typeof process !== "undefined" && process.title && process.title.includes('node') solves this issue.

christianalfoni commented 3 years ago

Excellent! 😄