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

Can't use console.log and have duplicate script tags since upgrading to 2.3.1 #2040

Closed
mannyreds11 opened this issue May 22, 2017 · 3 comments

Comments

@mannyreds11
Copy link

I can’t see any console.log placed on my component methods after upgrading to 2.3.1 when using npm run dev.

We’re using a custom _document.js and previously included <NextScript />.
We removed <NextScript /> because we noticed it was duplicating the inclusion of Next scripts (e.g. app.js) on the page. After removing it I can’t do console.log on client side when running in development mode.

@khrome83
Copy link
Contributor

I work with @mannyreds11 - Remove <NextScript /> does more than just impact console.log(), it also does not run any code that was present in our page or app.js files. In other words, we really need it.

Looking at view source, we do see two sets of tags though. One set in the head that is added without having <NextScript />, other other set is in the body before the close body tag because that is where <NextScript /> is used.

@arunoda
Copy link
Contributor

arunoda commented May 23, 2017

@khrome83 first one is a way to preload scripts. It's not duplicate. Check the type of the tags.
You must use <NextScript />

@arunoda arunoda closed this as completed May 23, 2017
@khrome83
Copy link
Contributor

khrome83 commented Jun 3, 2017

@arunoda - yeah i miss read it. Thank you for the reply. That did solve our problem.

@lock lock bot locked as resolved and limited conversation to collaborators May 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants