adapters icon indicating copy to clipboard operation
adapters copied to clipboard

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

Open dallyh opened this issue 1 year ago • 4 comments

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

  • npm run build-and-preview
  • Navigate to a page that causes 404, for example http://127.0.0.1:4321/test/test
[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 avatar Mar 29 '24 08:03 dallyh