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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: prefer #app useHead #271

Merged
merged 2 commits into from Aug 27, 2023

Conversation

huang-julien
Copy link
Contributor

Hi 馃憢
This PR resolve #250

I've been able to reproduce the issue within the playground as stated in a comment.

鈿狅笍 However, i do have a website which is currently in production with nuxt 3.6.5 WITHOUT this issue which makes me quite nervous if it reveals that the issue only happens for a small fractions of users.

So I noticed that useHead() could not injectHead() within the turnstile plugin. Switching the useHead() from #app seems to fix the issue locally for me.

Another note is that useHead from #app and useHead from #imports are not equal, even the body is different.

image

(maybe is it a nuxt treeshaking or deps optimization issue ?)

Since this issue is quite bizarre, i have no idea on how to reproduce it on e2e tests.

cc @harlan-zw

@codecov
Copy link

codecov bot commented Aug 26, 2023

Codecov Report

Merging #271 (77baf3d) into main (aafeb91) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #271   +/-   ##
=======================================
  Coverage   82.60%   82.60%           
=======================================
  Files           2        2           
  Lines         115      115           
  Branches       13       13           
=======================================
  Hits           95       95           
  Misses         20       20           

馃摚 We鈥檙e building smart automated test selection to slash your CI/CD build times. Learn more

@harlan-zw
Copy link

This is quite bizarre and worth investigating further, thanks for your efforts!

@dargmuesli dargmuesli merged commit eecd223 into nuxt-modules:main Aug 27, 2023
6 checks passed
danielroe added a commit that referenced this pull request Aug 27, 2023
Revert "fix: prefer #app useHead (#271)"

This reverts commit eecd223.
@danielroe
Copy link
Collaborator

I'm not sure this is the right solution. useHead from #app is deprecated. It looks like this is a bug in unhead or Nuxt which we need to resolve. Reverting on main; we can keep released version as a workaround for now.

dargmuesli pushed a commit that referenced this pull request Aug 28, 2023
## [0.6.1](v0.6.0...0.6.1) (2023-08-28)

### Bug Fixes

* **component:** readd `nextTick` import ([#274](#274)) ([d831058](d831058))
* use `useHead` from `[#imports](https://github.com/nuxt-modules/turnstile/issues/imports)` ([171e351](171e351)), closes [#271](#271)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NuxtTurnstile component not loading Turnstile script as expected
4 participants