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

Reference in nuxt-link.client.js to this.$nuxt causes error when custom globalName is set #8118

Closed
kswedberg opened this issue Sep 26, 2020 · 1 comment · Fixed by #8289
Closed

Comments

@kswedberg
Copy link

Versions

  • nuxt: v2.14.5
  • node: v12.18.3

Reproduction

I'm getting an error under circumstances it's hard to reproduce, but I'm pretty sure I see the the cause of the problem.

If I set globalName in nuxt.config.js to a custom name, I get an error (cannot get property fetchPayload of undefined).

The error is caused by the 2 lines that reference this.$nuxt: https://github.com/nuxt/nuxt.js/blob/dev/packages/vue-app/template/components/nuxt-link.client.js#L114-L115

I believe that changing this.$nuxt to this.<%= globals.nuxt %> (as it is in other places within that file) should fix the problem.

It's strange that it gets past the condition, though. Maybe webpack resolve this.$nuxt to true when it's being built, thus exposing this.$nuxt.fetchPayload?

@stale
Copy link

stale bot commented Nov 1, 2020

Thanks for your contribution to Nuxt.js!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you would like this issue to remain open:

  1. Verify that you can still reproduce the issue in the latest version of nuxt-edge
  2. Comment the steps to reproduce it

Issues that are labeled as pending will not be automatically marked as stale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants