-
-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
When using createContext, SSR is broken for me. I'm getting this errors in the console when starting Next.js:
ReferenceError: CustomEvent is not defined
at dispatchEvent (file:///Users/eike.foken/Code/test-ui/node_modules/.pnpm/[email protected]/node_modules/atomico/src/element/set-prototype.js:95:50)
at ref.<computed> (file:///Users/eike.foken/Code/test-ui/node_modules/.pnpm/[email protected]/node_modules/atomico/src/hooks/custom-hooks/use-event.js:11:13)
at detectContext (file:///Users/eike.foken/Code/test-ui/node_modules/.pnpm/[email protected]/node_modules/atomico/src/context.js:21:9)
at load (file:///Users/eike.foken/Code/test-ui/node_modules/.pnpm/[email protected]/node_modules/atomico/src/hooks/hooks.js:19:56)
at file:///Users/eike.foken/Code/test-ui/node_modules/.pnpm/[email protected]/node_modules/atomico/src/hooks/hooks.js:21:24
at useHook (file:///Users/eike.foken/Code/test-ui/node_modules/.pnpm/[email protected]/node_modules/atomico/src/hooks/create-hooks.js:14:15)
at useState (file:///Users/eike.foken/Code/test-ui/node_modules/.pnpm/[email protected]/node_modules/atomico/src/hooks/hooks.js:17:12)
at useContext (file:///Users/eike.foken/Code/test-ui/node_modules/.pnpm/[email protected]/node_modules/atomico/src/context.js:35:49)
at useTheme (webpack-internal:///../packages/styles/src/theme/theme-provider.ts:19:68)
And also later on (if I polyfill CustomEvent with an empty function):
TypeError: node.dispatchEvent is not a function
Expected behavior
No errors in console
*SSR/SSG environment (Optional, required if the problem is caused by using SSR/SSG, please complete the following information):
- Environment version: [email protected]
- Framework: Next.js 12.2.6
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working