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

Cannot read properties of undefined (reading 'STORYBOOK') #637

Closed
RBlanchet opened this issue Jun 6, 2024 · 7 comments
Closed

Cannot read properties of undefined (reading 'STORYBOOK') #637

RBlanchet opened this issue Jun 6, 2024 · 7 comments

Comments

@RBlanchet
Copy link

RBlanchet commented Jun 6, 2024

Hello 🙌,

I am encountering an issue with the Storybook module in a newly created fresh Nuxt project.

Steps to Reproduce:

  1. Create a new Nuxt project (actually 3.11.2) using the command: npx nuxi@latest init test-nuxt
  2. Add the Storybook module version 8.0.0 using: npx nuxi@latest module add storybook
  3. Run the development server with: yarn run dev

Error

When running the development server, the following error is displayed

Cannot start nuxt:  Cannot read properties of undefined (reading '__STORYBOOK__') 

Workaround:

Manually changing the property import.meta.env to process.env in the module.mjs file resolves the issue and the application runs successfully.

It seems to be potentially linked to this development #512 in module 8.0.0

Could you please provide guidance on how to resolve this issue without manually modifying the module file?

Thank you for your support !

@sifferhans
Copy link

This is a duplicate of #538 I think 😁

@seancrater
Copy link

I'm having this issue as well

@mehcode
Copy link
Contributor

mehcode commented Jun 6, 2024

I think we're all waiting on a patch release of the module. 🙏 @chakAs3

@jimmiejackson414
Copy link

^ It's been happening since the v8.0.0 release from 2 months ago.

@mehcode
Copy link
Contributor

mehcode commented Jun 6, 2024

It works if you use the git sha in your package.json but pre-pack is then failing in github actions for me, so going to look at another option.

@seancrater
Copy link

I can't seem to get the suggested workaround to work with Yarn either

@mehcode
Copy link
Contributor

mehcode commented Jun 6, 2024

@seancrater et all, I pushed a git dep that's pre-built here - github:mehcode/storybook#bundle, I find that some times the all the bundling makes git deps fail

This dep in my devDependencies makes it work for me:

"@nuxtjs/storybook": "github:mehcode/storybook#bundle",

@tobiasdiez tobiasdiez closed this as not planned Won't fix, can't repro, duplicate, stale Jun 7, 2024
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

6 participants