You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't know about the inner working but I think currently vite ssr requires applying ssrFixStacktrace for server error. As shown in the repro, currently line/column in stacktrace is a little off without this.
I found that the best timing to apply this is already provided by handleError convention, so currently there is a user-side workaround by making use of external plugin to provide ViteDevServer instance in user code (for example, @vavite/expose-vite-dev-server or @hiogawa/vite-import-dev-server).
However, I was wondering if it would make sense to apply ssrFixStacktrace by default in remix plugin in some way.
I haven't think about how such implementation would look like yet, but I thought I would create this issue first in case other people also noticed something odd about error stack when testing remix vite.
hi-ogawa
changed the title
vite: apply ViteDevServer.ssrFixStacktrace for server error by default?
vite: server error stack is off a few lines (apply ViteDevServer.ssrFixStacktrace for server error by default?)
Nov 20, 2023
hi-ogawa
changed the title
vite: server error stack is off a few lines (apply ViteDevServer.ssrFixStacktrace for server error by default?)
vite: server error stack log is off a few lines (apply ViteDevServer.ssrFixStacktrace for server error by default?)
Nov 20, 2023
hi-ogawa
changed the title
vite: server error stack log is off a few lines (apply ViteDevServer.ssrFixStacktrace for server error by default?)
vite: server error stack log is a few lines off (apply ViteDevServer.ssrFixStacktrace for server error by default?)
Nov 20, 2023
hi-ogawa
changed the title
vite: server error stack log is a few lines off (apply ViteDevServer.ssrFixStacktrace for server error by default?)
vite: server error stack log is a few lines off
Nov 20, 2023
hi-ogawa
changed the title
vite: server error stack log is a few lines off
vite: error stacktrace is a few lines off in dev server log
Nov 20, 2023
hi-ogawa
changed the title
vite: error stacktrace is a few lines off in dev server log
Vite dev: error stacktrace is a few lines off in dev server log
Nov 23, 2023
Reproduction
I created a reproduction with a potential user-side workaround in https://github.com/hi-ogawa/remix-vite-stacktrace-repro.
(I forked to stackblitz but it seems
ssrFixStacktrace
is broken on stackblitz runtime currently, so the same thing cannot be reproduced. It's not useful but just for reference https://stackblitz.com/edit/hi-ogawa-remix-vite-stacktrace-repro-yanxgp.)I don't know about the inner working but I think currently vite ssr requires applying
ssrFixStacktrace
for server error. As shown in the repro, currently line/column in stacktrace is a little off without this.I found that the best timing to apply this is already provided by
handleError
convention, so currently there is a user-side workaround by making use of external plugin to provideViteDevServer
instance in user code (for example,@vavite/expose-vite-dev-server
or@hiogawa/vite-import-dev-server
).However, I was wondering if it would make sense to apply
ssrFixStacktrace
by default in remix plugin in some way.I haven't think about how such implementation would look like yet, but I thought I would create this issue first in case other people also noticed something odd about error stack when testing remix vite.
System Info
Used Package Manager
pnpm
Expected Behavior
server error stack should be correct
Actual Behavior
server error stack is a few lines off
The text was updated successfully, but these errors were encountered: