Skip to content

DTK0032: Dock Launch Error

Package: @vitejs/devtools

Message

Error launching dock entry "{id}"

Cause

A dock entry's onLaunch() handler threw an error during execution. When the DevTools client triggers a launcher-type dock entry, the devtoolskit:internal:docks:on-launch RPC function calls the entry's onLaunch() callback. If that callback throws, the error is caught, this diagnostic is logged (not thrown), and the dock entry's launcher status is set to 'error' with the error message attached. The original error is available as the cause of this diagnostic.

Example

ts
context.docks.register({
  id: 'my-plugin:dock',
  label: 'My Dock',
  type: 'launcher',
  launcher: {
    status: 'idle',
    onLaunch: async () => {
      // If this throws, DTK0032 is logged
      const port = await startDevServer()
      if (!port) {
        throw new Error('Failed to start dev server')
      }
    },
  },
})

Fix

Check the original error attached as cause in the log output to determine what went wrong in your onLaunch handler. Common issues include:

  • A build step or dev server failing to start
  • Missing dependencies or misconfigured paths
  • Network errors when fetching external resources

Add error handling within your onLaunch callback to provide better diagnostics:

ts
context.docks.register({
  id: 'my-plugin:dock',
  label: 'My Dock',
  type: 'launcher',
  launcher: {
    status: 'idle',
    onLaunch: async () => {
      try {
        await startDevServer()
      }
      catch (error) {
        console.error('[my-plugin] Failed to start:', error)
        throw error // re-throw so the dock status reflects the error
      }
    },
  },
})

After the error is resolved, the user can retry the launch from the DevTools UI. The dock entry's status will show 'error' with the error message until a successful launch.

Source

packages/core/src/node/rpc/internal/docks-on-launch.ts

Released under the MIT License.