feat(types): support custom VitePreloadErrorEvent#17615
Conversation
|
|
|
Would it also be relevant to cast the actual error being thrown in https://github.com/vitejs/vite/blob/main/packages/vite/src/node/plugins/importAnalysisBuild.ts#L148 Doing something like this in the const e: VitePreloadErrorEvent = new Event('vite:preloadError', { cancelable: true })
e.payload = err
window.dispatchEvent(e)
if (!e.defaultPrevented) {
throw err
}I think that will also make it possible to remove the |
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
|
As @MathiasWP said, do you think we need to customize a |
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
If it's possible to cast then that would be great, but I don't know if there's complications doing that when the types come from |
|
The type is not complicated, it is simpler to just declare one. |
|
Feedback for whoever, in typescript this makes is more complicated to spyOn as there is now a colliding overload. |
Description
close #17508