Skip to content

Nuxt UI x server endpoint x storybook #3826

Open
@harkor

Description

@harkor

Environment

Is this bug related to Nuxt or Vue?

Nuxt

Version

v3.16.2

Reproduction

https://github.com/harkor/storybook-nuxtui-server

If you want same result without my repo.

npx nuxi init -t ui <app-name>
# Choose nuxt-ui
cd <app-name>
pnpm dlx storybook@latest init
# Example: Add a file like "hello.ts" inside ./server/api
pnpm run storybook

Description

When I want to use Storybook with my Nuxt project with Nuxt UI I have an error (see logs section).

If I remove ./server/api/hello.ts, everything is working.

Tailwind seems to try to import server files that provide the error.

Do we have a config property to disable importing tailwind server folder ?

Additional context

No response

Logs

[12:35:01 PM]  ERROR  Internal server error: Importing from server is not allowed in the Vue part of your app. [importing ../../../../server/api/hello.ts from index.html]
  Plugin: vite:css-analysis

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriagev3#1289

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions