Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NextJS Dynamic Imports With No SSR - ReferenceError: window is not defined #57

Open
danwetherald opened this issue Jul 15, 2021 · 0 comments

Comments

@danwetherald
Copy link

We are in the need of a way to somehow get around a bunch of issues with SSR pixels.

We have a pixels component that uses context to get pixel information (pixel ids, tracking ids, etc). This component then can dynamically initialize the pixels from an array of different services (ie. facebook, snap, tikok, pinterest, etc).

The problem we are stuck with now is that we can't seem to figure out a way to get around the issue of the window being undefined when rendering this pixels component using NextJS.

Most resources point in this direction, but not sure how this will be possible with rescript?
https://nextjs.org/docs/advanced-features/dynamic-import#with-no-ssr

ReferenceError: window is not defined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant