Missing LifecycleHooks.SERVER_PREFETCH in 'vue-next/packages/runtime-core/src/errorHandling.ts'
Version
3.1.2
Reproduction link
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.
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',
If it helps, this seems to be a related issue.
@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