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
Adding any script to root layout (or layout or page) causing an error in clean next 13 repo #42519
Comments
I am unable to reproduce this, given the repo you linked to. Everything loads fine. Have you been able to resolve the issue? Otherwise, this might be OS/Browser-specific. 🤔 |
Yes i can confirm. I just cloned the repo as is and ran npm i and npm run dev and directly get the error are soon as i open the browser. |
I get the same error when embedding the script in the root layout. Here is the repo https://github.com/nevsky118/my-app Chrome Version 107.0.5304.88 (Official Build) (64-bit)
|
We tried in the office on a Mac and it works fine. seems to me a 64bit issue? Operating System: warn - Latest canary version not detected, detected: "13.0.1", newest: "13.0.3-canary.0". |
I tried updating and got same behavior |
I got similar errors trying in my RootLayout
console
also I if add in my case I was trying to add a simple script for dark mode, so it won't flash the screen, and I ended doing for now
it works but dev mode complains about dom being different between server and client, I guess it won't happen using next/script after it gets fixed? info
|
I'm experiencing a similar issue. It doesn't happen when I build from WSL but it does happen when I build from windows (both PowerShell and git bash). So it seems this might be a windows only issue. Unfortunately building in WSL from a /mnt/ directory doesn't allow for filesystem update events so no hot reloading or file updates after the next initially loads the file so it isn't really a development option. |
do this problem is still active? |
On Windows `cunkGroup.name` is `app\layout` rather than `app/layout`. This causes it to get the wrong chunks in `flight-manifest.json` for `next/script` in this case: ```json "chunks": ["webpack:webpack", "amp:amp"], ``` After checking for backslash: ```json "chunks":["app\\layout:app\\layout"], ``` fixes #42519 ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md) ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] [e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md) ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm build && pnpm lint` - [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
Operating System:
Platform: win32
Arch: x64
Version: Windows 10 Home
Binaries:
Node: 16.13.1
npm: N/A
Yarn: N/A
pnpm: N/A
Relevant packages:
next: 13.0.1
eslint-config-next: 13.0.1
react: 18.2.0
react-dom: 18.2.0
What browser are you using? (if relevant)
Chrome 106.0.5249.119
How are you deploying your application? (if relevant)
next dev -p 5000
Describe the Bug
Tried adding google analytics tag script to root layout file as follows:
but gets the following error as soon as the page gets hydrated
also in the console i see
i noticed that when i run the project with next build and then next start i only get the console warning
Expected Behavior
The page should load normally and the script called.
Link to reproduction
https://github.com/madaher-dev/next13.git
To Reproduce
Follow docs to install clean next 13 project
create app directory and page and root layout
import next/script to root layout
use any script in the root template html
The text was updated successfully, but these errors were encountered: