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

No optional chaining when accessing import.meta.env.__STORYBOOK__ in npm dist #570

Closed
lukebui opened this issue Apr 25, 2024 · 1 comment

Comments

@lukebui
Copy link

lukebui commented Apr 25, 2024

Inside the setup function, the code looks for import.meta.env.__STORYBOOK__ to make sure that storybook is setup.

In the source code, the if statement checks import.meta.env?.__STORYBOOK__, with optional chaining to make sure that import.meta.env is not undefined.

However, in the distributed npm package, the optional chaining is absent, causing problems when setting up storybook.

@nuxtjs/storybook version: 8.0.0
Nuxt version: 3.11.2
Node versions: 18.20.2
OS: WSL for Windows

Steps to reproduce:

  1. Create new Nuxt project: npx nuxi@latest init nuxt-project
  2. Install @nuxtjs/storybook: npx nuxi@latest module add storybook
  3. Check in the node_modules directory to see that the distributed code is different from the source code.

image

@lukebui lukebui closed this as completed Apr 25, 2024
@lukebui
Copy link
Author

lukebui commented Apr 25, 2024

Duplicate of #538

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant