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

🐛: Fixed Dynamic server usage error #848

Closed
wants to merge 2 commits into from

Conversation

xannyxs
Copy link
Contributor

@xannyxs xannyxs commented Aug 7, 2024

Pull Request Info

Description

Please include a summary of the change and which issue is fixed, or which feature has been implemented.

Fixes (issue)
#659

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Additional context:

Fix found here:
https://stackoverflow.com/questions/75051613/digest-dynamic-server-usage-nextjs-13

@xannyxs xannyxs added the bug Something isn't working label Aug 7, 2024
@xannyxs xannyxs requested a review from pblvrt August 7, 2024 10:14
Copy link

vercel bot commented Aug 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
streameth-platform ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 7, 2024 11:37am

@xannyxs xannyxs marked this pull request as draft August 7, 2024 11:19
@xannyxs
Copy link
Contributor Author

xannyxs commented Aug 7, 2024

After further investigation, I've discovered some interesting behavior with Next.js static generation:

  1. generateStaticParams() may not be functioning as expected. Despite Next.js indicating SSG (Static Site Generation) in the build summary, it seems to default to dynamic page loading.

  2. As a test, I removed generateStaticParams(), and the page size in the build summary remained unchanged. This suggests that the function might not be having the intended effect on static generation.

  3. The root cause is still unclear, but it may be related to our use of cookies in organizationService.tsx. The dynamic access to cookies could be forcing pages to be rendered dynamically.

  4. Using export const dynamic = 'force-static' removes the error, but it's uncertain if this actually results in static rendering.

Key Observations:

  • Next.js may be defaulting to dynamic rendering even when we expect static generation.
  • The use of cookies in our services might be incompatible with true static generation.
  • The force-static option resolves errors but may not guarantee static rendering.

Relevant Documentation:

@xannyxs xannyxs requested a review from greatsamist August 7, 2024 11:28
@greatsamist
Copy link
Contributor

Issue resolved. There was a generateStaticParams function causing issues due to its asynchronous behavior and unnecessary code execution.
see in a743139

@greatsamist greatsamist deleted the fix/dynamic_store_error branch August 13, 2024 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Weird message when building the app ( investigate )
3 participants