-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Storybook not loading - Uncaught undefined #8115
Comments
Hey, I cloned the repo and wasn't able to reproduce the issue.. the website shows up for me in Chrome. Is this on a certain browser or operating system? |
@FrozenPandaz I can confirm this (brand new repo Same steps as above (mac monterey and chrome)
Report
|
@FrozenPandaz oddly enough the e2e test works 🤔 |
I can see the same issue in a new workspace :
I skipped the application step but have also tried using a MFE remote application rather than the Angular library to the same result. Environment
|
The culprit is
|
After more poking around. The issue seems to have introduced somewhere after 13.2.4. I can get it storybook to load when backing the version to 13.2.4 with the following script: #!/usr/bin/env bash
# VERSION=13.2.4 # Works
VERSION=13.3.1 # Doesn't work
PROJECT_DIR=ng13
npx -y "create-nx-workspace@${VERSION}" --preset=angular --appName=demo --style=scss --nx-cloud=false "${PROJECT_DIR}"
cd "${PROJECT_DIR}"
npm i -D "@nrwl/storybook@${VERSION}"
nx g @nrwl/angular:component todos --project=demo --export
nx g @nrwl/angular:storybook-configuration demo --configureCypress --generateStories --generateCypressSpecs
nx run demo:storybook |
We were able to reproduce this in our workshop yesterday as well. |
I had the same issue today on fresh NX workspace (for Angular) |
I will add that just downgrading to 13.2.4 in a workspace created for 13.3.1 does not fix it so it my be an issue with another dependency. |
I have reproduced this as well on a brand new angular nx workspace |
After juggling dependencies back and forth I was able to make it work with followg:
however when I have created brand new workspace and copied the dependencies it was still failing... so I have copied package-lock.json (attached) and after |
This did the trick completely (had to use the actual |
Looking into this ppl! :) |
Can you please tell me the steps you tried, and paste here your
@klingebiel @gom3s @johannesnormannjensen your issue is true even for new workspaces? My
|
I am also experiencing this, doesn't work even if I use version 13.2.4.
|
@electrofLy Can you please share your repo? I have just created a blank Nx workspace, and it works for me. Was this after upgrading/migrating, or was this from a new repo? |
Ahhhhhh @electrofLy I see your |
People, I really think this has been fixed as of |
@mandarini yes it still persist if I use Unfortunately I cannot share the repository and I don't really have time now to try to create a reproducable repo. A difference I can see with your repo is that we use |
Interesting @electrofLy . So in your
? I am wondering what might be wrong, if all our versions are aligned... I'll try running this with node 14, maybe there's an issue there? |
@electrofLy was this in a brand new repo? Or is this after migration? |
It finally works for me. |
Ohhh that's wonderful news!!!! @klingebiel |
So, here's the thing. I tried new workspace, I tried @gom3s @johannesnormannjensen @electrofLy If it's still there, please let me know if it's in a new workspace, and if not, which version you migrated from. We'll get to the bottom of this! :) |
hello @mandarini
|
Hmm that's interesting. So, your Storybook server starts fine, then you open the browser, navigate to localhost:4400 and in the console you see the React-related errors? And you run Storybook like |
@mandarini as strange as this looks after adding those 2 dependencies my issue si resolved:
The |
wowwwww thanks so much @electrofLy !!! that's a great lead! I'll look into it! |
This resolved the issue for me too, thank you! I'd also like to raise awareness of this unrelated Storybook issue — I encountered it when creating a new workspace for debugging purposes. |
I also confirm that adding devDependency on react and react-dom solved the issue for me! thnx @electrofLy |
@gom3s so, your |
@lukeribchester was this a new workspace? or an existing one? is it angular-only? does it have an |
I'm keeping this open, I have not yet managed to reproduce, or understand how the What I suggest for anyone who runs into this issue or this issue persists for them:
|
Yes, that is correct. I saw React errors in console on 13.1.1 angular and there was no errors in terminal |
Disclaimer: I first encountered this issue with a new production workspace on 16-12-2021. I'm unable to reproduce this issue today in a test workspace following these same commands. For possible future reference I've documented the initial commands I executed (aside from those to install some trivial dependencies).
# Workspace
$ npm install -g nx
$ npx create-nx-workspace
# Angular
$ npm install -D @nrwl/angular
$ nx g @nrwl/angular:application
# NestJS
$ npm install -D @nrwl/nest
$ nx g @nrwl/nest:application
# Storybook
$ npm install -D @nrwl/storybook
$ nx g @nrwl/angular:storybook-configuration client
$ nx run client:storybook
$ npm install [email protected] [email protected]
Node : 16.13.1
OS : darwin arm64
npm : 8.1.2
nx : 13.3.6
@nrwl/angular : 13.3.6
@nrwl/cli : 13.3.6
@nrwl/cypress : 13.3.6
@nrwl/devkit : 13.3.6
@nrwl/eslint-plugin-nx : 13.3.6
@nrwl/express : undefined
@nrwl/jest : 13.3.6
@nrwl/linter : 13.3.6
@nrwl/nest : 13.3.6
@nrwl/next : undefined
@nrwl/node : 13.3.6
@nrwl/nx-cloud : undefined
@nrwl/react : undefined
@nrwl/react-native : undefined
@nrwl/schematics : undefined
@nrwl/tao : 13.3.6
@nrwl/web : undefined
@nrwl/workspace : 13.3.6
@nrwl/storybook : 13.3.8
@nrwl/gatsby : undefined
typescript : 4.4.4
rxjs : 7.4.0
---------------------------------------
Community plugins:
@angular/animations: 13.1.1
@angular/cdk: 13.1.1
@angular/common: 13.1.1
@angular/compiler: 13.1.1
@angular/core: 13.1.1
@angular/forms: 13.1.1
@angular/material: 13.1.1
@angular/platform-browser: 13.1.1
@angular/platform-browser-dynamic: 13.1.1
@angular/router: 13.1.1
@angular-devkit/build-angular: 13.0.4
@angular/cli: 13.0.4
@angular/compiler-cli: 13.1.1
@angular/language-service: 13.1.1
@storybook/angular: 6.4.9 @mandarini I noticed that the 'community plugins' section above lists different versions of Angular packages compared to those listed in package.json (partial): "dependencies": {
"@angular/animations": "^13.0.0",
"@angular/cdk": "^13.1.1",
"@angular/common": "^13.0.0",
"@angular/compiler": "^13.0.0",
"@angular/core": "^13.0.0",
"@angular/flex-layout": "^13.0.0-beta.36",
"@angular/forms": "^13.0.0",
"@angular/material": "^13.1.1",
"@angular/platform-browser": "^13.0.0",
"@angular/platform-browser-dynamic": "^13.0.0",
"@angular/router": "^13.0.0",
"@nestjs/common": "^8.0.0",
"@nestjs/core": "^8.0.0",
"@nestjs/platform-express": "^8.0.0",
"react": "^16.14.0",
"react-dom": "^16.14.0",
"reflect-metadata": "^0.1.13",
"rxjs": "~7.4.0",
"tslib": "^2.0.0",
"zone.js": "~0.11.4"
} Thank you! |
Unfortunately these steps don't fix the issue in my workspace given its state prior to step two as documented here. As I mentioned I also can't seem to reproduce this in a new workspace today, so my two known solutions are installing the React development dependencies or migrating to a new workspace. If I have time I'll run |
@gom3s the thing is that Storybook would not work for Angular |
@lukeribchester I'm glad that you can not reproduce the issue any more, it should not exist now. If you're having trouble running Storybook |
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. |
Hello all! Closing this for now. If it comes up again, please reopen. But make sure you have the latest versions of Storybook/Nx! <3 |
New docs for |
This fixed it for me:
Thanks @mandarini! |
In case it helps someone, my issue was that I had a major version mismatch between |
Hey, this worked! Thanks mate! @miguelh72 |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Current Behavior
Running the
nx run storybook:<project>
command successfully builds and deploys Storybook, but when navigating to http://localhost:4400 it only displays a blank page and throws some errors in the console (see below).Expected Behavior
Storybook should should start without errors.
Steps to Reproduce
I have created a reproduction here: https://github.com/klingebiel/nx-storybook-issue
You can run
npm run storybook
and navigate to http://localhost:4400 to reproduce the issue.I set up the workspace with the following steps:
create-nx-workspace
Failure Logs
Environment
The text was updated successfully, but these errors were encountered: