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 causing runtime error TypeError: Cannot read property 'tagName' of null #26158

Closed
yunghzz35 opened this issue Jun 16, 2021 · 2 comments · Fixed by #26253
Closed
Labels
bug Issue was opened via the bug report template.

Comments

@yunghzz35
Copy link

What version of Next.js are you using?

11

What version of Node.js are you using?

14.17.1

What browser are you using?

Chrome Version 91.0.4472.77

What operating system are you using?

macOS Version 11.3

How are you deploying your application?

next start

Describe the Bug

Using the new next/script introduced in next 11 instead of <script /> tag causing Uncaught (in promise) TypeError: Cannot read property 'tagName' of null

Expected Behavior

Should load the script successfully without runtime error

To Reproduce

import Head from "next/head";
import Script from 'next/script';
const Meta = ({
    title,
    keywords,
    description
}) => {
    return (
        <Head>
            <Script src="/example.min.js" strategy="beforeInteractive" /> // <-- causing Uncaught (in promise) TypeError: Cannot read property 'tagName' of null
       </Head>
  )
}

export default Meta;

Screenshot 2021-06-16 at 11 26 20 AM

@yunghzz35 yunghzz35 added the bug Issue was opened via the bug report template. label Jun 16, 2021
@Vadorequest
Copy link
Contributor

Reproducing the same, tried various options of strategy but they all lead to the same error.

@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 28, 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
3 participants