Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using @nuxt/ui-pro components gives "Missing NUXT_UI_PRO_LICENSE license key" error #755

Open
theunsa opened this issue Aug 15, 2024 · 1 comment
Labels
status: help wanted Good idea, but the core developers will not work on it at the moment type: bug Something isn't working

Comments

@theunsa
Copy link

theunsa commented Aug 15, 2024

Issue

At the moment this module fails when the builder detects a missing NUXT_UI_PRO_LICENSE key in a project using Nuxt UI Pro components:

$ pnpm run storybook

> nuxt-app@ storybook /Users/theuns/Projects/plumbline/avoda-ui
> storybook dev --port 6006

storybook v8.2.9

The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
info => Starting manager..
info => Starting preview..
ℹ Nuxt Icon server bundle mode is set to local                                                                                                                                    8:54:20 PM
ℹ Using default Tailwind CSS file                                                                                                                                nuxt:tailwindcss 8:54:20 PM
ℹ 🔌  Storybook Module Setup                                                                                                                                                      8:54:20 PM
ℹ                                                                                                                                                                                 8:54:20 PM
ℹ 📚  Storybook is configured                                                                                                                                                     8:54:20 PM
ℹ                                                                                                                                                                                 8:54:20 PM
Running with compatibility version `4`
=> Failed to build the preview
Error: Error: Missing `NUXT_UI_PRO_LICENSE` license key.
Purchase Nuxt UI Pro at `https://ui.nuxt.com/pro/pricing` to build your app in production.

Reason to support this

Given that Nuxt is so kind to allow the Nuxt UI Pro components for free during development (and only require license when you deploy to production), it would make sense for Storybook to cater for this use case given that Storybook is such a valuable tool during the initial design & dev phase of a web app project.

Extra info

  "devDependencies": {
    "@nuxtjs/storybook": "7.0.2",
    "@storybook-vue/nuxt": "0.2.6",
    "@storybook/addon-essentials": "8.2.9",
    "@storybook/addon-interactions": "8.2.9",
    "@storybook/addon-links": "8.2.9",
    "@storybook/blocks": "8.2.9",
    "@storybook/builder-vite": "8.2.9",
    "@storybook/test": "8.2.9",
    "@storybook/vue3": "8.2.9",
    "nuxt": "^3.12.4",
    "storybook": "8.2.9"
  },
  
 node: v20.15.0

I've tried

My assumption is that Storybook's vite always builds in "production" mode which triggers the "Missing NUXT_UI_PRO_LICENSE license key" condition, even if it runs as storybook dev --port 6006. So I've tried to force the mode in nuxt.config.ts, but to no avail:

vite: {
    build: {
        mode: 'development'
    },
}

To reproduce

Add Nuxt UI Pro components to your nuxt app by following these two steps:
https://ui.nuxt.com/pro/getting-started/installation

@tobiasdiez tobiasdiez added the type: bug Something isn't working label Aug 16, 2024
@tobiasdiez
Copy link
Collaborator

I looked into this and storybook actually sets the mode to development: https://github.com/storybookjs/storybook/blob/87c37572bb986271c407700cf75f950e70325cdf/code/builders/builder-vite/src/vite-config.ts#L32-L36

Not sure if this is a) not triggered correctly b) overwritten somewhere or c) not detected properly by nuxt ui.

@tobiasdiez tobiasdiez added the status: help wanted Good idea, but the core developers will not work on it at the moment label Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: help wanted Good idea, but the core developers will not work on it at the moment type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants