Skip to content

Next.js 15.0-canary.104 Causes an "Error: Maximum call stack size exceeded" in the Nodemailer adapter #7580

Closed

Description

@rainer-friederich

Link to reproduction

No response

Payload Version

3.0 beta 76

Node Version

20 LTS

Next.js Version

15.0.0-104

Describe the Bug

After adding a nodemailer Adapter and clicking some pages the site crashes with "Error: Maximum call stack size exceeded". Removing the NodeMailer Adapter solves this problem.

See also the discord thread: https://discord.com/channels/967097582721572934/1031993785971900556/threads/1270936640021336105

Reproduction Steps

  • Use latest 3.0 release
  • Add a Nodemailer with transport options configuration
  • Open payload, the first visit will work
  • Reload the page -> See the error
  • Remove email config from payload config file
  • Reload the page -> Error gone.

Adapters and Plugins

No response

Activity

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

    @tomekwlod

    I am not sure if this is related, but I am experiencing a similar error type but caused by node_modules/deepmerge lib. Everything was working fine until versions higher than 3.0 beta 67. For me, the error occurs in dev mode as soon as I start the server and save any file in my IDE. If I don't trigger a server reload, everything operates normally.

    Here is the error message I am receiving:

    RangeError: Maximum call stack size exceeded
        at Array.filter (<anonymous>)
        at getEnumerableOwnPropertySymbols (webpack-internal:///(rsc)/./node_modules/deepmerge/dist/cjs.js:54:42)
    .....
      52 | function getEnumerableOwnPropertySymbols(target) {
      53 | 	return Object.getOwnPropertySymbols
    > 54 | 		? Object.getOwnPropertySymbols(target).filter(function(symbol) {
         | ^
      55 | 			return Object.propertyIsEnumerable.call(target, symbol)
      56 | 		})
      57 | 		: []
     ⨯ node_modules/deepmerge/dist/cjs.js (54:1) @ getEnumerableOwnPropertySymbols
     ⨯ RangeError: Maximum call stack size exceeded
        at Array.filter (<anonymous>)
        at Array.forEach (<anonymous>)
    ......
    

    Forgive me if my case is not related. I will create a new issue if needed.

  3. rainer-friederich commented on Aug 8, 2024

    @rainer-friederich
    Author

    It is related

  4. rainer-friederich commented on Aug 8, 2024

    @rainer-friederich
    Author

    I guess this is a Next.js problem in the later versions. For me it only affects the dev server. The prod build runs smooth.

    Update: I don't have the problem with the dev server anymore with 15.0.0-canary.108 instead of 104
    Update 2 : I still have the problem after some code changes the problem re-appeared

  5. changed the title [-]3.0 Beta 76 - Nodemailer adapter causes Error: Maximum call stack size exceeded[/-] [+]Next.js 15.0-canary.104 Causes an "Error: Maximum call stack size exceeded" in the Nodemailer adapter[/+] on Aug 8, 2024
  6. talpha14 commented on Aug 8, 2024

    @talpha14

    Screenshot 2024-08-08 234141

    I'm not sure where the error comes from

  7. jomapps commented on Aug 9, 2024

    @jomapps

    I can second this issue. Happening to me.

  8. 58bits commented on Aug 10, 2024

    @58bits
    Contributor

    Also seeing this...

  9. credli commented on Aug 10, 2024

    @credli

    .

  10. added
    status: verified
    and removed
    status: needs-triage
    on Aug 10, 2024
  11. paulpopus commented on Aug 10, 2024

    @paulpopus
    Member

    Hey all, we're going to take a look at this ASAP

  12. 58bits commented on Aug 11, 2024

    @58bits
    Contributor

    Hi @paulpopus - thanks for the quick response.

    For interest, commenting out the email and nodemailerAdapter configuration also seems to prevent Maximum call stack size exceeded for us.

    However, on the latest beta 77 and Next canary.104 ., I'm seeing another (possibly related?) problem. 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.

    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).

    If this is totally unrelated to this issue, I'll go ahead and raise a separate issue with a demo repo.

  13. 58bits commented on Aug 11, 2024

    @58bits
    Contributor

    @paulpopus @denolfe - here's a forked Demo 3 repo with the admin dashboard problem above:

    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

  14. remarcable commented on Aug 11, 2024

    @remarcable

    @58bits you might be referring to this bug: #7578

  15. 58bits commented on Aug 11, 2024

    @58bits
    Contributor

    @remarcable - thanks - I've just looked at #7578 - and their description is similar - but in the reproducible repo above richtext does not have to appear in a block although I'll post my comment above and link there.

  16. rainer-friederich commented on Aug 12, 2024

    @rainer-friederich
    Author

    Any update on this? Any hint on how to mitigate this without sacrificing the ability to send emails would be greatly appreciated.

  17. jmikrut commented on Aug 12, 2024

    @jmikrut
    Member

    Actively looking into this now!

  18. added 2 commits that reference this issue on Aug 12, 2024
    e569014
    b33b5f4
  19. jmikrut commented on Aug 12, 2024

    @jmikrut
    Member

    This is now fixed and will be released shortly. Thank you everyone!

    The Lexical / Rich Text issues are going to be addressed separately via #7620.

    That should hopefully be merged tomorrow!

    For anyone running into issues like @58bits I believe if you instantiate a new Lexical editor for each field that causes you problems, that will fix it in the meantime. When the above PR lands, you won't need to do that anymore.

  20. removed
    status: verified
    on Aug 12, 2024
  21. denolfe commented on Aug 13, 2024

    @denolfe
    Member
  22. 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.

  23. 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

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions