Skip to content

Failed to fetch dynamically imported module in Storybook with Sveltekit #3094

Closed Answered by anubra266
cmseeling asked this question in Q&A
Discussion options

You must be logged in to vote

@cmseeling the storybook config accepts a viteFinal object, could you try configuring there also

// .storybook/main.ts

import type { StorybookConfig } from '@storybook/react-vite'
import { defineConfig, mergeConfig } from 'vite'

const config: StorybookConfig = {
  //...
  viteFinal: async (config) => {
    return mergeConfig(
      config,
      defineConfig({
        server: {
          fs: {
            allow: ['styled-system'],
          },
        },
      }),
    )
  },
}

I'm not sure if allow needs a relative path to styled-system but you can try that out.

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by cmseeling
Comment options

You must be logged in to vote
2 replies
@anubra266
Comment options

@cmseeling
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants