NextJS 13 Bug: Tracing Instrumentation breaks next/link
elements with prefetching
#260
Labels
bug
Report a bug
next/link
elements with prefetching
#260
Description
Enabling the Tracing Instrumentation in a Next13 project (App Router) with Faro breaks link that use prefetching (which is set to true for all links by default).
Steps to reproduce
I've included an example on CodeSandbox that you can fork to test it out on your own Faro Project :)
Fork this codesandbox project.
Create a Faro Project
Enter your project URL and project name into the corresponding environment variables in
.env.local
Note that the
<Link/>
component on line 37 has it's prefetch set totrue
Click on the Link
Note that the link has been clicked ('link clicked!' message in console) but no routing has occured (still on the same page)
Now set prefetch on the link on line 37 to
false
Refresh the window
Click on the Link and notice that you are routed to the correct URL (now on test-route page)
Expected behavior
We expect that you are able to successfully route in both cases, with or without prefetching.
Actual behavior
Routing with next/link only works with TracingInstrumentation if prefetching is explicitly disabled for all
<Link/>
componentsEnvironment
Demo
CodeSandbox Link
https://codesandbox.io/p/sandbox/crazy-matan-g5f27w?file=%2Fnext.config.js%3A1%2C1
Demo Video
Next13-Faro-Routing-issue-demo.mp4
Context
Wasn't sure whether to report this on Faro repo, otel-js repo, or NextJS repo but if this is something that you all think belongs on there instead, I'll close this issue :)
The text was updated successfully, but these errors were encountered: