diff --git a/packages/devtools/client/components/StacktraceList.vue b/packages/devtools/client/components/StacktraceList.vue new file mode 100644 index 0000000000..aff60dfdc9 --- /dev/null +++ b/packages/devtools/client/components/StacktraceList.vue @@ -0,0 +1,42 @@ + + + diff --git a/packages/devtools/client/components/TimelineDetailsFunction.vue b/packages/devtools/client/components/TimelineDetailsFunction.vue index c1b11c8d5e..d555395c69 100644 --- a/packages/devtools/client/components/TimelineDetailsFunction.vue +++ b/packages/devtools/client/components/TimelineDetailsFunction.vue @@ -5,20 +5,8 @@ const props = defineProps<{ record: TimelineEventFunction }>() -const config = useServerConfig() const timeAgo = useTimeAgo(() => props.record.start, { showSecond: true }) -function urlToFilepath(url: string) { - let pathname = new URL(url).pathname - if (pathname.startsWith('/_nuxt/')) - pathname = pathname.slice(6) - if (pathname.startsWith('/@id/virtual:nuxt:')) - return `#build/${pathname.split('/.nuxt/')[1]}`.replace(/\.m?js$/, '') - if (pathname.includes('/@fs/')) - return `/${pathname.split('/@fs/')[1]}` - return (config.value?.rootDir || '') + pathname -} - const autoImports = useAutoImports() const importsMetadata = computed(() => autoImports.value?.metadata) const importItem = computed(() => { @@ -60,19 +48,9 @@ const importItem = computed(() => { -
- -
+ diff --git a/packages/devtools/client/pages/modules/error.vue b/packages/devtools/client/pages/modules/error.vue new file mode 100644 index 0000000000..c3ee1c0c33 --- /dev/null +++ b/packages/devtools/client/pages/modules/error.vue @@ -0,0 +1,78 @@ + + + diff --git a/packages/devtools/src/runtime/plugins/devtools.client.ts b/packages/devtools/src/runtime/plugins/devtools.client.ts index aefb83cecd..c38b3b8487 100644 --- a/packages/devtools/src/runtime/plugins/devtools.client.ts +++ b/packages/devtools/src/runtime/plugins/devtools.client.ts @@ -55,8 +55,8 @@ export default defineNuxtPlugin((nuxt: any) => { }) import('./view/client') - .then(({ setupDevToolsClient }) => { - setupDevToolsClient({ + .then(async ({ setupDevToolsClient }) => { + await setupDevToolsClient({ nuxt, clientHooks, timeMetric, diff --git a/packages/devtools/src/runtime/plugins/view/Main.vue b/packages/devtools/src/runtime/plugins/view/Main.vue index 78d86ecce8..c1c3be3837 100644 --- a/packages/devtools/src/runtime/plugins/view/Main.vue +++ b/packages/devtools/src/runtime/plugins/view/Main.vue @@ -57,6 +57,8 @@ const draggingOffset = reactive({ x: 0, y: 0 }) const mousePosition = reactive({ x: 0, y: 0 }) function onPointerDown(e: PointerEvent) { + if (!panelEl.value) + return isDragging.value = true const { left, top, width, height } = panelEl.value!.getBoundingClientRect() draggingOffset.x = e.clientX - left - width / 2 diff --git a/playgrounds/tab-timeline/components/GlobalNav.vue b/playgrounds/tab-timeline/components/GlobalNav.vue index 4c8dd5cdcf..e40e8d8d9c 100644 --- a/playgrounds/tab-timeline/components/GlobalNav.vue +++ b/playgrounds/tab-timeline/components/GlobalNav.vue @@ -23,6 +23,9 @@ /dynamic-bar + + /error + diff --git a/playgrounds/tab-timeline/nuxt.config.ts b/playgrounds/tab-timeline/nuxt.config.ts index 60a24a6f51..8583d03731 100644 --- a/playgrounds/tab-timeline/nuxt.config.ts +++ b/playgrounds/tab-timeline/nuxt.config.ts @@ -4,7 +4,7 @@ export default defineNuxtConfig({ '../../packages/devtools-ui-kit/src/module', '../../local', ], - ssr: false, + ssr: true, vite: { clearScreen: false, }, diff --git a/playgrounds/tab-timeline/pages/empty.vue b/playgrounds/tab-timeline/pages/empty.vue index 04e2cc2de7..7b648447f1 100644 --- a/playgrounds/tab-timeline/pages/empty.vue +++ b/playgrounds/tab-timeline/pages/empty.vue @@ -1,5 +1,4 @@