Skip to content

Conversation

@Pato-desu
Copy link
Collaborator

No description provided.

@netlify
Copy link

netlify bot commented Nov 6, 2025

Deploy Preview for pauseai ready!

Name Link
🔨 Latest commit 85c5c52
🔍 Latest deploy log https://app.netlify.com/projects/pauseai/deploys/69189d4bcc4c8500086d173c
😎 Deploy Preview https://deploy-preview-538--pauseai.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 51 (🔴 down 2 from production)
Accessibility: 89 (no change from production)
Best Practices: 100 (no change from production)
SEO: 98 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@Pato-desu
Copy link
Collaborator Author

Pato-desu commented Nov 6, 2025

Issue: #533

@Pato-desu
Copy link
Collaborator Author

Pato-desu commented Nov 6, 2025

  • Make this basic stuff work

  • Switch to new members table

    • Change titles
    • Add images
    • Change URL
  • Tom and new chapter leads need to upload a photo and a bio. Or maybe it makes sense to use the bio from the statement page.

  • Add links to page (check out old ones: https://github.com/PauseAI/pauseai-website/pull/345/files)

  • Ella requests

    • 'About Pause AI page'
    • And the staff structured in their roles?
    • a little story of how pauseAI started @joepio and where it has come - big wins (in like a short narrative fashion or a timeline with pics)

@Pato-desu
Copy link
Collaborator Author

There's a 500 internal error in /people i don't know how to fix.
@joepio @anthonybailey @Wituareard can any of you take care of it, please?

@Pato-desu
Copy link
Collaborator Author

I don't understand much of the changes i did, the code is basically the same as before when the page was running

@joepio
Copy link
Collaborator

joepio commented Nov 7, 2025

No 500 here in local dev on your branch, works fine @Pato-desu . I'm assuming you're missing the Airtable token.

However, I do see a different issue. We currently use the old volunteers table that has been migrated to a new one, but in the migration the photo's have been lost. So we have to move the photos.

@Pato-desu
Copy link
Collaborator Author

Pato-desu commented Nov 7, 2025

Yeah, i know. Same with titles. Its in the bullet TODO points

@anthonybailey
Copy link
Collaborator

anthonybailey commented Nov 7, 2025

From previous experience "no 500 here in local dev" does not predict no 500 in the wild, alas. (Which is what we have in the preview, to be clear.)

Was that using the Netlify CLI @joepio ? No need to invest, just a y/n

I can look at this issue. Also have opinions on some of the "where shall we manage the relevant data?" questions the todos imply.

@Pato-desu
Copy link
Collaborator Author

Also have opinions on some of the "where shall we manage the relevant data?" questions the todos imply.

what data?

@Wituareard
Copy link
Collaborator

Wituareard commented Nov 8, 2025

@anthonybailey I tracked down the error to this line in paraglide bc "window" is defined in Deno but "window.location" seems to be undefined. But I have no idea why "setLocale" would be called in the first place https://github.com/opral/monorepo/blob/b951344b1f976a0f34729909d659c1fa2de6ae88/inlang/packages/paraglide/paraglide-js/src/compiler/runtime/set-locale.js#L112

@Wituareard
Copy link
Collaborator

Wituareard commented Nov 8, 2025

And it might also mean that we can't serve any dynamic pages whatsoever at the moment? We don't have any non-API routes in production afaik

@anthonybailey
Copy link
Collaborator

what data?

We store names and emails and team assignments in a mess of old and new Airtables.

In general, we've had some success representing structured data that changes over time and is presented on website pages as JSON in the source-controlled repository rather than in a database. Allows pages to be static, etc.

@Pato-desu
Copy link
Collaborator Author

So, I don't know what you guys did but it was working today for me so thanks for that.
Now I changed the table and it's broken again.
Will see if i can fix it tomorrow.

@Wituareard
Copy link
Collaborator

Uhh, I don't think anything changed and I still get a 500 on /people

@Pato-desu
Copy link
Collaborator Author

@Wituareard I may should be doing something on my side. I stopped trying to do so because what usually happens to me is: I sometimes get 500 error, then I reload, I get the fallback data, then i reload, and get the actual people.

Could this be something that will get fixed once public?

@anthonybailey
Copy link
Collaborator

That is not likely, but given our lack of clarity anything is possible.

(I observe similar behaviour with the page on the preview site. First fetch from a sufficiently new client is always a 500. Future attempts succeed very consistently. No correlated problems on other pages.)

@Pato-desu
Copy link
Collaborator Author

All my comments were about the preview, sorry, I thought I clarified it but I only did to Joep in his DMs.
I was finally able to run stuff locally and it's working fine so... 🤷. Should we worry about the preview?

Testing first-request behavior on cold start
@anthonybailey
Copy link
Collaborator

Investigation Update: 500 Error on /people Route

Successfully Reproduced the Issue

We've definitively reproduced and identified the root cause of the 500 error on first access to /people.

Confirmed Pattern

  1. First request to cold edge function: HTTP 500 (~6 seconds)
  2. Subsequent requests: HTTP 200 (work correctly)
  3. Edge function stays warm for multiple requests after initialization

Root Cause

The error occurs during paraglide locale initialization in Netlify Edge Functions (Deno runtime):

  • The initialization code checks typeof window !== "undefined"
  • In production Deno, window exists but window.location is undefined
  • Accessing window.location.href throws an error, causing the 500 response
  • Once the edge function is warm, subsequent requests bypass the failing initialization

Evidence

  • Reproduced with curl on fresh deployments (commit fb949da)
  • Confirmed with browser testing
  • When multiple users hit a cold edge simultaneously, multiple edge instances can spin up (multiple 500s observed)
  • Local testing with Deno 2.2.4 does NOT reproduce the issue (different window object behavior)

Why It Works Locally

  • pnpm preview: Runs in Node.js where window is undefined on server
  • netlify serve: Uses local Deno 2.2.4 where window is fully undefined
  • Production: Uses unknown Deno version with partial window object

Potential Solutions

  1. Immediate fix: Change prerender = false to prerender = true in /people/+page.ts (make page static)

    • Pros: Eliminates the issue entirely
    • Cons: Loses dynamic functionality if needed
  2. Runtime patch: Fix paraglide initialization to check window.location existence

    • Add proper checks: typeof window !== "undefined" && typeof window.location !== "undefined"
    • Location: src/lib/paraglide/runtime.js lines ~147 and ~300
  3. Configuration workaround: Exclude /people from edge function handling

    • Modify netlify configuration to serve this route differently

Speculation

The production Deno version appears to be older than 2.2.4 with different window object implementation. Geographic distribution may affect which edge nodes/versions serve requests.

The caching layer (1-hour TTL based on User-Agent) masks the issue for most users after the first visitor takes the hit.

@anthonybailey
Copy link
Collaborator

This all matches with the other issue where we saw a 500 in production after introducing a dynamic route for our statement: #370 (and PR #379)

It overlaps with issues we had with preview-all-locales (many notes from PR #325) but is distinct in that for the latter case I can partially reproduce some problems locally.

I can see quick fixes, but give me a few more hours and there's a decent chance everything finally untangles much more.

anthonybailey pushed a commit that referenced this pull request Nov 12, 2025
- Creates /api/deno-version endpoint configured for edge runtime
- Reports Deno version, window object status, and window.location availability
- Will help identify differences between local (Deno 2.2.4) and production environments
- Related to investigation of 500 errors on dynamic routes (#538, #540)
anthonybailey pushed a commit that referenced this pull request Nov 13, 2025
Changes isServer detection from build-time constant to runtime check.

Problem:
- import.meta.env.SSR evaluates to false in edge functions
- Bundler optimizes away !isServer guard as dead code
- Code tries to access window.location.href in Netlify's Deno runtime
- Netlify provides window object but window.location is undefined
- Crash: "Cannot read properties of undefined (reading 'href')"

Solution:
- Use runtime check: typeof window === "undefined" || typeof window.location === "undefined"
- Correctly identifies edge functions as server-side (isServer = true)
- Prevents bundler from removing the guard
- Works in Node.js, Netlify Edge (Deno 2.3.1), and browsers

Also removes importRuntimeWithoutVite() workaround - no longer needed
with runtime isServer check that works in all contexts.

Related: #538, #540
@Wituareard
Copy link
Collaborator

Closing this PR was probably accidental @anthonybailey ?

@Wituareard Wituareard reopened this Nov 15, 2025
@Wituareard
Copy link
Collaborator

It seems to work, not getting any errors on my side

@Wituareard
Copy link
Collaborator

@anthonybailey Do you think we can merge?

@anthonybailey
Copy link
Collaborator

I am just bringing the fix from main now. If I closed this it was in error.

@Wituareard
Copy link
Collaborator

I've already merged it

@anthonybailey anthonybailey marked this pull request as ready for review November 15, 2025 16:54
@anthonybailey anthonybailey merged commit 62f5714 into main Nov 15, 2025
5 checks passed
@Pato-desu
Copy link
Collaborator Author

ok, i'll move the task list left to the issue itself

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

Successfully merging this pull request may close these issues.

5 participants