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

Cloudflare v10 navigating to a non-existent page (404) with React causes react minified errors with Wrangler #214

Open
1 task
dallyh opened this issue Mar 29, 2024 · 4 comments
Labels
- P3: minor bug An edge case that only affects very specific usage (priority) pkg: cloudflare upstream

Comments

@dallyh
Copy link

dallyh commented Mar 29, 2024

Astro Info

Astro                    v4.5.12
Node                     v20.12.0
System                   Windows (x64)
Package Manager          npm
Output                   hybrid
Adapter                  @astrojs/cloudflare
Integrations             @astrojs/react

Describe the Bug

When using v10 version of the adapter, hybrid output mode and React integration, navigating to a page which causes 404 causes multiple React minified errors when previewing with Wrangler.

Steps to reproduce

[wrangler:inf] Ready on http://127.0.0.1:4321
⎔ Starting local server...
X [ERROR] Error: Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7B%7D for the full message or use the non-minified dev environment for full errors and additional helpful warnings.

      at Z
  (file:///C:/Users/honda/Documents/Repos/astro-cf-10-issues/.wrangler/tmp/pages-FlcOXO/renderers.mjs:217:491)
      at Zc
  (file:///C:/Users/honda/Documents/Repos/astro-cf-10-issues/.wrangler/tmp/pages-FlcOXO/renderers.mjs:211:485)
      at Z
  (file:///C:/Users/honda/Documents/Repos/astro-cf-10-issues/.wrangler/tmp/pages-FlcOXO/renderers.mjs:217:89)
      at Uc
  (file:///C:/Users/honda/Documents/Repos/astro-cf-10-issues/.wrangler/tmp/pages-FlcOXO/renderers.mjs:225:218)
      at null.<anonymous>
  (file:///C:/Users/honda/Documents/Repos/astro-cf-10-issues/.wrangler/tmp/pages-FlcOXO/renderers.mjs:237:279)
      at new Promise (<anonymous>)
      at reactDomServer_browser_production_min.renderToReadableStream
  (file:///C:/Users/honda/Documents/Repos/astro-cf-10-issues/.wrangler/tmp/pages-FlcOXO/renderers.mjs:236:83)
      at renderToReadableStreamAsync
  (file:///C:/Users/honda/Documents/Repos/astro-cf-10-issues/.wrangler/tmp/pages-FlcOXO/renderers.mjs:499:47)
      at Object.renderToStaticMarkup
  (file:///C:/Users/honda/Documents/Repos/astro-cf-10-issues/.wrangler/tmp/pages-FlcOXO/renderers.mjs:416:17)
      at renderFrameworkComponent
  (file:///C:/Users/honda/Documents/Repos/astro-cf-10-issues/.wrangler/tmp/pages-FlcOXO/chunks/astro_Bticr204.mjs:1614:68)
  Error: Minified React error #31; visit
  https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7B%7D for
  the full message or use the non-minified dev environment for full errors and additional helpful
  warnings.
      at Z
  (file:///C:/Users/honda/Documents/Repos/astro-cf-10-issues/.wrangler/tmp/pages-FlcOXO/renderers.mjs:217:491)
      at Zc
  (file:///C:/Users/honda/Documents/Repos/astro-cf-10-issues/.wrangler/tmp/pages-FlcOXO/renderers.mjs:211:485)
      at Z
  (file:///C:/Users/honda/Documents/Repos/astro-cf-10-issues/.wrangler/tmp/pages-FlcOXO/renderers.mjs:217:89)
      at Uc
  (file:///C:/Users/honda/Documents/Repos/astro-cf-10-issues/.wrangler/tmp/pages-FlcOXO/renderers.mjs:225:218)
      at null.<anonymous>
  (file:///C:/Users/honda/Documents/Repos/astro-cf-10-issues/.wrangler/tmp/pages-FlcOXO/renderers.mjs:237:279)
      at new Promise (<anonymous>)
      at reactDomServer_browser_production_min.renderToReadableStream
  (file:///C:/Users/honda/Documents/Repos/astro-cf-10-issues/.wrangler/tmp/pages-FlcOXO/renderers.mjs:236:83)
      at renderToReadableStreamAsync
  (file:///C:/Users/honda/Documents/Repos/astro-cf-10-issues/.wrangler/tmp/pages-FlcOXO/renderers.mjs:499:47)
      at Object.renderToStaticMarkup
  (file:///C:/Users/honda/Documents/Repos/astro-cf-10-issues/.wrangler/tmp/pages-FlcOXO/renderers.mjs:416:17)
      at renderFrameworkComponent
  (file:///C:/Users/honda/Documents/Repos/astro-cf-10-issues/.wrangler/tmp/pages-FlcOXO/chunks/astro_Bticr204.mjs:1614:68)


[wrangler:inf] GET /test/test 404 Not Found (21ms)  

What's the expected result?

No errors should be thrown.

Link to Minimal Reproducible Example

https://github.com/dallyh/astro-cf-10-issues/tree/minified-react-errors

Participation

  • I am willing to submit a pull request for this issue.
@dallyh dallyh changed the title Cloudflare v10 navigating to a non-existent page (404) with React cause react minified errors with Wrangler Cloudflare v10 navigating to a non-existent page (404) with React causes react minified errors with Wrangler Mar 29, 2024
@alexanderniebuhr alexanderniebuhr added pkg: cloudflare needs triage Issue needs to be triaged labels Mar 29, 2024
@alexanderniebuhr
Copy link
Member

I think it might be solved if #211 is solved.. But I'll need to investigate that further :)

@alexanderniebuhr alexanderniebuhr added - P3: minor bug An edge case that only affects very specific usage (priority) and removed needs triage Issue needs to be triaged labels Apr 22, 2024
@alexanderniebuhr
Copy link
Member

Ok I played with this a little bit.. I have no idea why this happens ...
Even fixing all other react related issues, doesn't seem to resolve this 🤔

@alexanderniebuhr
Copy link
Member

I don't expect this to be fixed by v11, but might be worth to try again.

@dallyh
Copy link
Author

dallyh commented Jun 23, 2024

Indeed it did not help, i updated the repo branch.

[wrangler:inf] GET /test/test 404 Not Found (20ms)                                                                                                                                                                                                                           
X [ERROR] Error: Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7B%7D for the full message or use the non-minified dev environment for full errors and additional helpful warnings.

...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P3: minor bug An edge case that only affects very specific usage (priority) pkg: cloudflare upstream
Projects
None yet
Development

No branches or pull requests

2 participants