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

Missing LifecycleHooks.SERVER_PREFETCH in 'vue-next/packages/runtime-core/src/errorHandling.ts' #4013

Closed
beastrovich opened this issue Jun 28, 2021 · 6 comments · Fixed by #4014
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. 🐞 bug Something isn't working

Comments

@beastrovich
Copy link
Contributor

beastrovich commented Jun 28, 2021

Version

3.1.2

Reproduction link

https://sfc.vuejs.org/#eyJBcHAudnVlIjoiPHNjcmlwdCBsYW5nPVwidHNcIj5cbiAgaW1wb3J0IHsgb25TZXJ2ZXJQcmVmZXRjaCB9IGZyb20gJ3Z1ZSc7XG5cdG9uU2VydmVyUHJlZmV0Y2goKCkgPT4ge30pO1xuPC9zY3JpcHQ+In0=

Steps to reproduce

Accidentally stumbled onto this trying to configure apollo extension for quasar. Calling injectHook with LifecycleHooks.SERVER_PREFETCH as the first parameter causes an exception because the ErrorTypeStrings record does not contain an entry for LifecycleHooks.SERVER_PREFETCH.

What is expected?

A warning that i'm doing things wrong.

What is actually happening?

A confusing error.

@posva
Copy link
Member

posva commented Jun 28, 2021

@LordTerabyte The link is broken, can you fix it?

@beastrovich
Copy link
Contributor Author

beastrovich commented Jun 28, 2021

I'm trying, but honestly there is no reproduction code, because the missing thing is obvious just by looking at the source code.
I literally just added a single line into "\node_modules@vue\runtime-core\dist\runtime-core.esm-bundler.js" and it fixed the problem.

Like this:

const ErrorTypeStrings = {
    ["sp" /* SERVER_PREFETCH */]: 'serverPrefetch hook', // this line added
    ["bc" /* BEFORE_CREATE */]: 'beforeCreate hook',

@beastrovich
Copy link
Contributor Author

Just take a look please, I swear I'm not just wasting your time.
Thank you!

@beastrovich
Copy link
Contributor Author

If it helps, this seems to be a related issue.

@beastrovich
Copy link
Contributor Author

I managed to actually setup a working reproduction link. That sfc playground is confusing.

@LinusBorg LinusBorg added 🐞 bug Something isn't working 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. labels Jun 28, 2021
beastrovich pushed a commit to beastrovich/vue-next that referenced this issue Jun 28, 2021
@adamdehaven
Copy link

@LinusBorg are these ErrorTypeStrings exported for use in a consuming package?

Example: I'm setting up a onErrorCaptured hook and while the info string has value while running the dev server (e.g. outputs mounted hook) it only returns an integer in production. I'd like to surface the actual underlying string mounted hook to our error logging but need access to ErrorTypeStrings in order to do so

@github-actions github-actions bot locked and limited conversation to collaborators Oct 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. 🐞 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants