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

Cannot get WDYR output from nextjs dynamically loaded component (e.g. for no-ssr use case) #276

Open
bram2000 opened this issue Jul 2, 2023 · 2 comments

Comments

@bram2000
Copy link

bram2000 commented Jul 2, 2023

Hello,

In Next.js (12) I'm using the dynamic import as recommended in the docs to prevent the component from breaking when server-side. Unfortunately I'm unable to get any output from WDYR for such components and my assumption is that it's related to the dynamic import (since it works fine in my other components which are imported as normal).

Is this a limitation of WDYR, or is there something I can do to get it working?

Thanks!

@bram2000
Copy link
Author

bram2000 commented Jul 4, 2023

Having tried to create an example of this in code sandbox, it seems that the library does in fact work with dynamically loaded components (at least in the very simple case), so I'm not actually sure why I can only get output for certain components within my app.

@jens-duttke
Copy link

This sounds similar to the problem I had, that why-did-you-render doesn't work with Next.js v13+ at all.

A workaround I found was to add include: [/./] to the why-did-you-render options, as described here:
#272 (comment)

Maybe this works for you issue as well.

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

2 participants