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

App router migration rollbar script #1118

Open
wants to merge 12 commits into
base: next-js-migration
Choose a base branch
from

Conversation

boodland
Copy link
Contributor

@boodland boodland commented Sep 3, 2024

Issue link / number:

#1083

What changes did you make?

Used Script nextjs tag
Set script strategy to beforeInteractive
Added rollbar configuration to root layout
Moved Script from _document to _app as seems to be an outdated pages router documentation bug see:
https://stackoverflow.com/questions/73813720/next-script-does-not-work-inside-document-js-file-nextjs
https://nextjs.org/docs/pages/api-reference/components/script#beforeinteractive
This documentation seems also wrong as next/script is not working on _document
https://nextjs.org/docs/messages/no-script-in-document
The following error is no longer triggered
https://nextjs.org/docs/messages/no-before-interactive-script-outside-document

Now the script is loaded in both pages and app router

Why did you make the changes?

In order to be able to have google tag manager within app router

Did you run tests?

Yes

Navigate to http://localhost:3000/ to check that the head rollbar script is added properly

image

Navigate to http://localhost:3000/public-route-test to check that the head rollbar script is added properly

image

Copy link

vercel bot commented Sep 3, 2024

@boodland is attempting to deploy a commit to the Chayn Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant