Skip to content
This repository was archived by the owner on Apr 6, 2023. It is now read-only.

fix: async script ran twice#8312

Closed
atinux wants to merge 1 commit intomainfrom
fix/head-async
Closed

fix: async script ran twice#8312
atinux wants to merge 1 commit intomainfrom
fix/head-async

Conversation

@atinux
Copy link
Member

@atinux atinux commented Oct 19, 2022

🔗 Linked issue

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

This PR is currently a reproduction of a script ran twice when using the async: true property.

nuxt.config.ts

export default defineNuxtConfig({
  app: {
    head: {
      script: [
        { src: '/script.js', async: true, body: true }
      ]
    }
  }
})

public/script.js

console.log('Hello script')

CleanShot 2022-10-19 at 10 09 41@2x

cc @harlan-zw

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@codesandbox
Copy link

codesandbox bot commented Oct 19, 2022

CodeSandbox logoCodeSandbox logo  Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

@netlify
Copy link

netlify bot commented Oct 19, 2022

Deploy Preview for nuxt3-docs canceled.

Name Link
🔨 Latest commit a83ea82
🔍 Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/634fb0c15af9d4000a88393f

@harlan-zw
Copy link
Collaborator

Hey @atinux

This was fixed in this PR and is available in v1.0.0-rc.11

@pi0
Copy link
Member

pi0 commented Oct 19, 2022

If you can confirm is fixed, shall we close this?

@danielroe danielroe closed this Oct 19, 2022
@pi0 pi0 deleted the fix/head-async branch October 19, 2022 12:52
@danielroe danielroe added the 3.x label Jan 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants