Skip to content

Conversation

@timozander
Copy link
Contributor

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

The PR fulfills these requirements:

  • When resolving a specific issue, it's referenced in the PR's title (e.g. fix #xxx[,#xxx], where "xxx" is the issue number)
  • All tests are passing
  • New/updated tests are included

Other information:
When using Pinia v2 with the latest beta of Vue devtools, I always experience the following console error:

backend.js:3166 ReferenceError: __VUE_DEVTOOLS_TOAST__ is not defined
    at pinia.esm-bundler.js?v=94b0b286:232
    at Object.addPlugin (backend.js:3162)
    at Object.<anonymous> (backend.js:908)
    at Object.emit (<anonymous>:1:780)
    at Object._replayBuffer (<anonymous>:1:332)
    at Object.on (<anonymous>:1:424)
    at connect (backend.js:907)

While I cannot exactly pin down the exact cause of this, I think its reasonable to fall back to console output whenever the devtools's toast is not available

@posva posva added the need repro This issue couldn't be reproduced label Jan 16, 2021
@posva
Copy link
Member

posva commented Jan 16, 2021

This is weird since the devtools should be installed at that point. I would need to have more details to ensure this is the right fix

@timozander
Copy link
Contributor Author

I found out that it is caused by the devtools failing to load a specific source (vuejs/devtools-v6#1322 (comment))

However, I think that adding this extra sanity check is reasonable since relying on globally available methods like this is always at the risk of failure, causing console spam

@timozander timozander requested a review from posva January 18, 2021 13:42
Copy link
Member

@posva posva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@posva posva changed the title fix: Error when _VUE_DEVTOOLS_TOAST_ is undefined fix: resilient _VUE_DEVTOOLS_TOAST_ Jan 18, 2021
@posva posva merged commit c0cacd2 into vuejs:v2 Jan 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

need repro This issue couldn't be reproduced

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants