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

next/script strategy="beforeInteractive" lint rules and usage conflict #36661

Closed
1 task done
GabenGar opened this issue May 3, 2022 · 5 comments
Closed
1 task done
Labels
bug Issue was opened via the bug report template.

Comments

@GabenGar
Copy link
Contributor

GabenGar commented May 3, 2022

Verify canary release

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

Provide environment information

Operating System:
Platform: win32
Arch: x64
Version: Windows 7
Binaries:
Node: 12.22.1
npm: N/A
Yarn: N/A
pnpm: N/A
Relevant packages:
next: 12.1.5
react: 18.0.0
react-dom: 18.0.0

What browser are you using? (if relevant)

firefox 99.0.1

How are you deploying your application? (if relevant)

vercel

Describe the Bug

The docs say strategy="beforeInteractive" requires next/script to be imported into __document page but the lint error says you can't use the next/script component inside the _document.js page.

Expected Behavior

Imported next/script not getting an error on __document page.

To Reproduce

Add import Script from "next/script" to the __document page.

@GabenGar GabenGar added the bug Issue was opened via the bug report template. label May 3, 2022
@thibautsabot
Copy link
Contributor

thibautsabot commented May 8, 2022

Hello!

The PR that introduced the new rule also disabled the old one.
Are you using the latest version of the eslint-config-next package? Do you have custom rules (.eslintrc.json)?

@GabenGar
Copy link
Contributor Author

GabenGar commented May 8, 2022

Are you using the latest version of the eslint-config-next package?

It's the same version as next in the info above.

Do you have custom rules (.eslintrc.json)?

The content of .eslinrc:

{
  "extends": ["next/core-web-vitals", "prettier"]
}

related packages:
eslint: 8.14.0,
eslint-config-prettier: ^8.5.0
prettier: 2.6.2

@thibautsabot
Copy link
Contributor

thibautsabot commented May 8, 2022

The fix has been included in v12.1.6.

Could you please upgrade both packages and try again?
Thank you!

@GabenGar
Copy link
Contributor Author

Yeah it is fixed in 12.1.6.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 9, 2022

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

No branches or pull requests

2 participants