Skip to content

Commit ff1d9b6

Browse files
Put back the process.browser === true check in isBrowserEnvironment for Next.js with "use client" to have the styles (fix #5679) (#5682)
1 parent c22a5dc commit ff1d9b6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/utils/device.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,9 @@ export function isLandscape () {
171171
* Check if running in a browser or spoofed browser (bundler).
172172
* We need to check a node api that isn't mocked on either side.
173173
* `require` and `module.exports` are mocked in browser by bundlers.
174+
* process is polyfilled with process.browser true by Next.js with "use client".
174175
*/
175-
export var isBrowserEnvironment = typeof process === 'undefined';
176+
export var isBrowserEnvironment = typeof process === 'undefined' || process.browser === true;
176177

177178
/**
178179
* Check if running in node on the server.

0 commit comments

Comments
 (0)