Skip to content

Scripts with async in Head are executed twice #9070

Description

@jonkwheeler

Bug report

Describe the bug

Scripts in the Head are run twice if marked async.

To Reproduce

Steps to reproduce the behavior:

  1. Create next app
  2. Create file at /static/log.js with console.log('hello'); inside
  3. Attach to a page (make sure to add the async attribute)
<NextHead>
  <script src="/static/log.js" async></script>
</NextHead>
  1. Run site
  2. See duplicate console.log in console.

Expected behavior

Scripts should only run once.

Screenshots

Screen Shot 2019-10-14 at 3 34 44 PM

System information

  • OS: macOS
  • Version of Next.js: latest 9.1.1

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions