Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@elastic/apm-rum breaks SPA behaviour #51656

Closed
1 task done
pierrechevaliercf opened this issue Jun 22, 2023 · 3 comments
Closed
1 task done

@elastic/apm-rum breaks SPA behaviour #51656

pierrechevaliercf opened this issue Jun 22, 2023 · 3 comments
Labels
bug Issue was opened via the bug report template. stale The issue has not seen recent activity.

Comments

@pierrechevaliercf
Copy link

pierrechevaliercf commented Jun 22, 2023

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

 Operating System:        
      Platform: win32        
      Arch: x64
      Version: Windows 10 Pro
    Binaries:
      Node: 18.12.1
      npm: N/A
      Yarn: N/A
      pnpm: N/A
    Relevant packages:       
      next: 13.4.8-canary.1  
      eslint-config-next: N/A
      react: 18.2.0
      react-dom: 18.2.0      
      typescript: N/A        

Which area(s) of Next.js are affected? (leave empty if unsure)

No response

Link to the code that reproduces this issue or a replay of the bug

https://github.com/pierrechevaliercf/NextSPAError

To Reproduce

Tested with next 13.4.6

1 - Install @elastic/apm-rum

npm i @elastic/apm-rum (5.12.0)

2 - Create a client component which will call and use this lib :

'use client';

 import init from "@elastic/apm-rum";

export function InitApm() {
    const a  = init; // just importing this function and calling it cause the error (commenting this line fix the behaviour)

    return null;
}

3 - Call this client component into your layout.tsx

4 - Navigate on your next app

5 - You will see that the SPA behaviour is now broken :

notspa

Describe the Bug

When @elastic/apm-rum is imported in a client component, the SPA behaviour no longer works, and navigation clicks fully reload the pages.

Expected Behavior

Next links should not reload the full page at each navigation click and works as an SPA even if @elastic/apm-rum is used.

Which browser are you using? (if relevant)

Chrome (114.0.5735.134) & Firefox (114.0.2 (64 bits))

How are you deploying your application? (if relevant)

No response

@pierrechevaliercf pierrechevaliercf added the bug Issue was opened via the bug report template. label Jun 22, 2023
@pierrechevaliercf
Copy link
Author

I've tested it again with 13.4.8-canary.1 and the issue still occurs

@nextjs-bot
Copy link
Collaborator

This issue has been automatically marked as stale due to two years of inactivity. It will be closed in 7 days unless there’s further input. If you believe this issue is still relevant, please leave a comment or provide updated details. Thank you.

@nextjs-bot nextjs-bot added the stale The issue has not seen recent activity. label Feb 16, 2025
@nextjs-bot
Copy link
Collaborator

This issue has been automatically closed due to two years of inactivity. If you’re still experiencing a similar problem or have additional details to share, please open a new issue following our current issue template. Your updated report helps us investigate and address concerns more efficiently. Thank you for your understanding!

@nextjs-bot nextjs-bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template. stale The issue has not seen recent activity.
Projects
None yet
Development

No branches or pull requests

2 participants