Skip to content

Troubleshooting the Storybook addon

Internal server error: Failed to resolve import “pathe”

The addon’s server code imports pathe. Some users report this error with pnpm and vite in a monorepo, where pathe is not hoisted to where the server code looks for it. The workarounds below come from a user report on Discord. This repository does not test them.

Add shamefully-hoist to your .npmrc:

.npmrc
shamefully-hoist=true

or hoist only the pathe package:

.npmrc
hoist-pattern[] = pathe

It takes empty snapshots on Vitest tests

Your tests are captured as if they were stories when the auto snapshot is on for them. Turn it off for plain tests by calling setAutoSnapshotOptions(false) in a beforeAll hook:

import { setAutoSnapshotOptions } from 'storybook-addon-vis'
import { beforeAll } from 'vitest'
beforeAll(() => setAutoSnapshotOptions(false))

The addon runs its own tests this way. See setAutoSnapshotOptions().