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'm developing vue 3 application using vite. tslog library is useful for me but unfortunately, I cannot make it showing correct log positions. I tried to set source maps in vite.config.ts and tsconfig.json but it didn't work. My log position always looks like this: /node_modules/.vite/deps/tslog.js:937
Did I miss come configuration step or it is not supported yet?
The text was updated successfully, but these errors were encountered:
After some investigation I found that stackDepthLevel value is wrong, at least when running with vite on my machine. In my case it's needed to use 6 instead of 5. Here is one of my stack frames:
at getCallerStackFrame (http://localhost:5173/node_modules/.vite/deps/tslog.js?v=720e19ab:559:55)
at Object.getMeta (http://localhost:5173/node_modules/.vite/deps/tslog.js?v=720e19ab:556:44)
at Logger._addMetaToLogObj (http://localhost:5173/node_modules/.vite/deps/tslog.js?v=720e19ab:871:50)
at Logger.log (http://localhost:5173/node_modules/.vite/deps/tslog.js?v=720e19ab:710:203)
at Logger.trace (http://localhost:5173/node_modules/.vite/deps/tslog.js?v=720e19ab:938:18)
at http://localhost:5173/src/composables/useWidget.ts:82:27
at http://localhost:5173/node_modules/.vite/deps/chunk-IDN7BJ6T.js?v=720e19ab:4845:40
at callWithErrorHandling (http://localhost:5173/node_modules/.vite/deps/chunk-IDN7BJ6T.js?v=720e19ab:2289:19)
at callWithAsyncErrorHandling (http://localhost:5173/node_modules/.vite/deps/chunk-IDN7BJ6T.js?v=720e19ab:2296:17)
at hook.__weh.hook.__weh (http://localhost:5173/node_modules/.vite/deps/chunk-IDN7BJ6T.js?v=720e19ab:4825:19)
So I fixed the problem by creating my custom logger class and passing 6 value to the base class
classMyLogger<T>extendsLogger<T>{constructor(settings?: ISettingsParam<T>,logObj?: T){super(settings,logObj);// @ts-ignore setting this private member as a workaround for https://github.com/fullstack-build/tslog/issues/302this.stackDepthLevel=6}}
I'm developing vue 3 application using vite. tslog library is useful for me but unfortunately, I cannot make it showing correct log positions. I tried to set source maps in
vite.config.ts
andtsconfig.json
but it didn't work. My log position always looks like this:/node_modules/.vite/deps/tslog.js:937
Did I miss come configuration step or it is not supported yet?
The text was updated successfully, but these errors were encountered: