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
Hi, I'm using snowpack API on server and in @emotion/react library there is a line of code const isBrowser = typeof document !== 'undefined'
snowpack evaluates this code to var isBrowser = "object" !== 'undefined';
and when I'm trying to import module const importedComponent = await runtime.importModule<{ default: FC }>( '/App.js' )
I'm getting ReferenceError: window is not defined at eval (/_snowpack/pkg/@emotion.react.v11.4.1.js:576:37)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, I'm using snowpack API on server and in @emotion/react library there is a line of code
const isBrowser = typeof document !== 'undefined'
snowpack evaluates this code to
var isBrowser = "object" !== 'undefined';
and when I'm trying to import module
const importedComponent = await runtime.importModule<{ default: FC }>( '/App.js' )
I'm getting
ReferenceError: window is not defined at eval (/_snowpack/pkg/@emotion.react.v11.4.1.js:576:37)
What I messed up?
Beta Was this translation helpful? Give feedback.
All reactions