Skip to content

Timeout after update to 3.0.0-beta.76 and next 15.0.0-canary.104 #7578

Closed

Description

@mednet-ecrep

Link to reproduction

No response

Payload Version

3.0.0-beta.76

Node Version

v20.9.0

Next.js Version

15.0.0-canary.104

Describe the Bug

After updating from payload beta 74 and next canary 86 to Payload beta 76 and Next Canary 104, the admin panel can no longer be accessed and results in a timeout. The login page does not render.

Before the update, everything was working perfectly.

The problem occurs only in a production build. Everything continues to work fine in development mode.

Reproduction Steps

Update to the payload 3.0.0-beta.76 and next canary 104. Create a and run a production build. Then try to access the payload login page.

Adapters and Plugins

db-mongodb, storage-vercel-blob, form-builder, nested-docs, seo, live-previewrichtext-lexical,

Activity

  1. added
    status: needs-triage
    on Aug 8, 2024
  2. Dovchik commented on Aug 8, 2024

    @Dovchik

    Encountering the same problem, runtime error:

    TypeError: Cannot read properties of undefined (reading 'query')
        at tV (/home/dovchik/source/payload-play/.next/server/chunks/8447.js:193:1420)
        at async Object.tz [as findGlobal] (/home/dovchik/source/payload-play/.next/server/chunks/8447.js:193:4292)
        at async l (/home/dovchik/source/payload-play/.next/server/chunks/8447.js:266:102390)
        at async f (/home/dovchik/source/payload-play/.next/server/chunks/6310.js:1:16628) {
      digest: '3855654830'
    }
    
    TypeError: Cannot read properties of undefined (reading 'query')
        at tV (/home/dovchik/source/payload-play/.next/server/chunks/8447.js:193:1420)
        at runNextTicks (node:internal/process/task_queues:60:5)
        at listOnTimeout (node:internal/timers:540:9)
        at process.processTimers (node:internal/timers:514:7)
        at async Object.tz [as findGlobal] (/home/dovchik/source/payload-play/.next/server/chunks/8447.js:193:4292)
        at async l (/home/dovchik/source/payload-play/.next/server/chunks/8447.js:266:102390)
        at async f (/home/dovchik/source/payload-play/.next/server/chunks/6310.js:1:16628) {
      digest: '343576256'
    }
    
  3. removed
    status: needs-triage
    on Aug 8, 2024
  4. jomapps commented on Aug 9, 2024

    @jomapps

    I just created another bug, which I will delete. Same error. Just upgraded from beta.36 though

  5. vuquangpham commented on Aug 10, 2024

    @vuquangpham

    I got the same issue now, but when I downgrade the next.js version to 15.0.0-canary.77, it works fine again?? What's going on here?

  6. 58bits commented on Aug 11, 2024

    @58bits
    Contributor

    Hi all - we're seeing a similar issue:

    On production builds only - i.e., pnpm build && pnpm start - the Payload admin app will not load if there is more than one collection with a richText field (they don't have to be nested in a block).

    For example - we created test Foo and Bar collections - based on the built-in Lexical richtext editor and in each there are only two fields: title (text) and content as (richText).

    Foo and Bar collections each have the following richtext field definition:

    {
    type: 'richText',
    name: 'richText',
    label: 'RichText',
    required: true,
    },

    We can compile and load the admin dashboard if we load just the Foo collection or just the Bar collection - but not both. We can only load both along with the admin dashboard in development. :-(

    In a production build - the request for the /admin URL remains stuck at 'pending' (with zero output - errors or other).

    Here's a link to a reproducible repo - a fork of Demo 3 repo.

    https://github.com/infonomic/payload-3.0-demo

    pnpm install && pnpm build && pnpm start - should reproduce the problem. All that's changed is another collection with a richText field was added to payload.config.ts. Navigating to /admin will fail on 'pending' indefinitely.

    Hope this helps.

  7. BohdanK-W32 commented on Aug 13, 2024

    @BohdanK-W32
    Contributor

    For us, everything works fine on payload 3.0.0-beta.77 and (!) next 15.0.0-canary.87.
    So it seems like an issue with the next >15.0.0-canary.87 (or newer).

  8. mednet-ecrep commented on Aug 13, 2024

    @mednet-ecrep
    Author

    Just updated to v3.0.0-beta.78 and still getting a timeout when loading the admin login page.

  9. robinscholz commented on Aug 13, 2024

    @robinscholz
    Contributor

    For us, everything works fine on payload 3.0.0-beta.77 and (!) next 15.0.0-canary.87. So it seems like an issue with the next >15.0.0-canary.87 (or newer).

    I can confirm. The admin panel works for us with 3.0.0-beta.78 and next 15.0.0-canary.87. Won’t work with next versions higher than that. We also have multiple richText fields in various places.

  10. AlessioGr commented on Aug 13, 2024

    @AlessioGr
    Member

    I recommend either staying on an older payload & Next.js version, or attaching an editor to every richtext field causing this issue for now. This issue has been introduced by the recent Next.js update - if objects with same references are passed down as props to 2+ components, Next.js started hanging like this. For richText fields, this issue can appear because they reference the same root richText editor.

    We will fix this once we're done with #7620

  11. robinscholz commented on Aug 13, 2024

    @robinscholz
    Contributor

    @AlessioGr attaching an editor to every richtText field does not seem to work for us. Tried both:

    Tried invoking the editor separately and passing it:

    import { lexicalEditor } from '@payloadcms/richtext-lexical'
    import type { RichTextField } from 'payload'
    
    // Hotfix: https://github.com/payloadcms/payload/issues/7578#issuecomment-2286571529
    export function contentField(editor: ReturnType<typeof lexicalEditor>) {
      const contentField: RichTextField = {
        name: 'content',
        type: 'richText',
        editor: editor,
      }
    
      return contentField
    }
    

    And tried setting it manually:

    import { lexicalEditor } from '@payloadcms/richtext-lexical'
    import type { RichTextField } from 'payload'
    
    const editor = lexicalEditor()
    
    export const contentField: RichTextField = {
      name: 'content',
      type: 'richText',
      editor: editor,
    }
    

    Running 3.0.0-beta.78 and next 15.0.0-canary.104

  12. AlessioGr commented on Aug 13, 2024

    @AlessioGr
    Member

    @robinscholz make sure you're using a uniquely initialized editor for every field, without sharing the editor object between fields

  13. AlessioGr commented on Aug 13, 2024

    @AlessioGr
    Member

    Fixed by #7620

  14. Dovchik commented on Aug 15, 2024

    @Dovchik

    Encountering the same problem, runtime error:

    TypeError: Cannot read properties of undefined (reading 'query')
        at tV (/home/dovchik/source/payload-play/.next/server/chunks/8447.js:193:1420)
        at async Object.tz [as findGlobal] (/home/dovchik/source/payload-play/.next/server/chunks/8447.js:193:4292)
        at async l (/home/dovchik/source/payload-play/.next/server/chunks/8447.js:266:102390)
        at async f (/home/dovchik/source/payload-play/.next/server/chunks/6310.js:1:16628) {
      digest: '3855654830'
    }
    
    TypeError: Cannot read properties of undefined (reading 'query')
        at tV (/home/dovchik/source/payload-play/.next/server/chunks/8447.js:193:1420)
        at runNextTicks (node:internal/process/task_queues:60:5)
        at listOnTimeout (node:internal/timers:540:9)
        at process.processTimers (node:internal/timers:514:7)
        at async Object.tz [as findGlobal] (/home/dovchik/source/payload-play/.next/server/chunks/8447.js:193:4292)
        at async l (/home/dovchik/source/payload-play/.next/server/chunks/8447.js:266:102390)
        at async f (/home/dovchik/source/payload-play/.next/server/chunks/6310.js:1:16628) {
      digest: '343576256'
    }
    

    @AlessioGr
    I'm still getting the same bunch of errors with build and start and admin panel not loading with [email protected] and [email protected]
    Also, I'm using postgres adapter

  15. Dovchik commented on Aug 15, 2024

    @Dovchik

    Okay, that seems to be related to how I passed payload instance around
    Seems that getPayloadHMR in root level of a document was breaking it all

  16. edtorba commented on Aug 26, 2024

    @edtorba
    Contributor

    It is still happening, running on next: 15.0.0-canary.128, payload: 3.0.0-beta.91, node: 20.9.0.

    Only after dropping lexical (which was used in just one collection) did things start working again.

  17. github-actions commented on Sep 6, 2024

    @github-actions
    Contributor

    This issue has been automatically locked.
    Please open a new issue if this issue persists with any additional detail.

  18. locked as resolved and limited conversation to collaborators on Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions