Skip to content

Unnecessary JS during dynamic import #6598

Closed

Description

@MarcinRapacz

Link to reproduction

No response

Payload Version

3.0.0-beta.36

Node Version

20.10

Next.js Version

15.0.0-rc.0

Describe the Bug

When using dynamically imported components in the demo, the amount of JS downloaded when entering the page increases from ~400 kB to 670 kB.

Code changes: MarcinRapacz/payload-demo-3.0.0-beta.36@979b74c

It looks like an additional chunk is being downloaded, which seems to be JS from Payload.

Demo:
image

After:
image

Reproduction Steps

  1. Compare the production version of the demo with the production version with the changes.
  2. Run pnpm build
  3. Run pnpm start

Adapters and Plugins

No response

Activity

  1. added
    status: needs-triage
    on Jun 2, 2024
  2. MarcinRapacz commented on Jun 9, 2024

    @MarcinRapacz
    Author

    Here's another example, but instead of using dynamic imports, I use 'use client' in one of the components.
    MarcinRapacz/payload-demo-3.0.0-beta.36@06c47ed

  3. jmikrut commented on Jun 10, 2024

    @jmikrut
    Member

    Hey @MarcinRapacz — this is being tracked here:

    vercel/next.js#65415

    Hopefully we will have a fix for this one way or another shortly. Keep an eye out on that PR!

  4. removed
    status: needs-triage
    on Jun 10, 2024
  5. added a commit that references this issue on Aug 5, 2024
  6. AlessioGr commented on Aug 13, 2024

    @AlessioGr
    Member

    This has been fixed by #7620

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

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

    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