hirotaka / storybook-addon-nuxt

This add-on makes it easier to set up Storybook in your Nuxt3 project.
78 stars 16 forks source link

Failed to resolve import "#tailwind-config" #4

Open vloss3 opened 1 year ago

vloss3 commented 1 year ago

Currently getting this error when I'm using a component in a story that requires Nuxt context/imports:

Failed to resolve import "#tailwind-config" from "../components/global/ItemList.vue". Does the file exist?
8:48:42 PM [vite] Internal server error: Failed to resolve import "#tailwind-config" from "../components/global/ItemList.vue". Does the file exist?
  Plugin: vite:import-analysis
  File: /Users/home/projects/project/components/global/ItemList.vue:46:0
  5  |  import { useLanguageApiPrefix } from '/Users/home/projects/project/compsables/mixins.ts';
  6  |  import { theme } from '#tailwind-config'

This is not specific only to #tailwind-config, here is an example with using Nuxt $config:

runtime.js:4 TypeError: Cannot read properties of undefined (reading '$config')
    at useRuntimeConfig (nuxt.js:227:22)'

Component:

<script>
  import { theme } from '#tailwind-config'
  ...
</script>

This is happening with the default configuration from the example(apart from components), please check, thank you!