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

Cypress E2E w/ Storybook baseUrl #14373

Closed
deegansiwicki opened this issue Jan 14, 2023 · 12 comments · Fixed by #14598
Closed

Cypress E2E w/ Storybook baseUrl #14373

deegansiwicki opened this issue Jan 14, 2023 · 12 comments · Fixed by #14598
Assignees
Labels
outdated scope: storybook Issues related to Storybook support in Nx scope: testing tools Issues related to Cypress / Jest / Playwright / Vitest support in Nx type: bug

Comments

@deegansiwicki
Copy link

Current Behavior

I am getting this error when running the e2e tests for my library with storybook configuration

Expected Behavior

To work

Github Repo

No response

Steps to Reproduce

  1. Run e2e test on library e2e app with storybook configuration (react)

Nx Report

Node : 16.18.1
   OS   : darwin arm64
   yarn : 3.3.1
   
   nx : 15.5.1
   @nrwl/angular : Not Found
   @nrwl/cypress : 15.5.1
   @nrwl/detox : 15.5.1
   @nrwl/devkit : 15.5.1
   @nrwl/esbuild : Not Found
   @nrwl/eslint-plugin-nx : 15.5.1
   @nrwl/expo : 15.5.1
   @nrwl/express : Not Found
   @nrwl/jest : 15.5.1
   @nrwl/js : 15.5.1
   @nrwl/linter : 15.5.1
   @nrwl/nest : 15.5.1
   @nrwl/next : 15.5.1
   @nrwl/node : 15.5.1
   @nrwl/nx-cloud : 15.0.2
   @nrwl/nx-plugin : Not Found
   @nrwl/react : 15.5.1
   @nrwl/react-native : Not Found
   @nrwl/rollup : 15.5.1
   @nrwl/schematics : Not Found
   @nrwl/storybook : 15.5.1
   @nrwl/web : 15.5.1
   @nrwl/webpack : 15.5.1
   @nrwl/workspace : 15.5.1
   @nrwl/vite : 15.5.1
   typescript : 4.8.4
   ---------------------------------------
   Local workspace plugins:
   ---------------------------------------
   Community plugins:

Failure Logs

<s> [webpack.Progress] 99% done plugins
<s> [webpack.Progress] 99% 
<s> [webpack.Progress] 99% cache store build dependencies
<s> [webpack.Progress] 99% cache store build dependencies
<s> [webpack.Progress] 99% cache begin idle
<s> [webpack.Progress] 99% cache begin idle
<s> [webpack.Progress] 100% 
╭────────────────────────────────────────────────╮
│                                                │
│   Storybook 6.5.15 for React started           │
│   5.75 s for preview                           │
│                                                │
│    Local:            http://localhost:4400/    │
│    On your network:  http://localhost:4400/    │
│                                                │
╰────────────────────────────────────────────────╯
 >  NX   Cannot read properties of undefined (reading 'baseUrl')
TypeError: Cannot read properties of undefined (reading 'baseUrl')

Additional Information

No response

@ms-tng
Copy link
Contributor

ms-tng commented Jan 16, 2023

Looks like it's due to #14306.
This PR looks at an info property in the output of the Storybook executor, but that executor adds it only when you're already on Storybook v7.

@bosycom
Copy link

bosycom commented Jan 16, 2023

@ms-tng Good find! Seems like the developer forgot to additionally add a check for Storybook 7 in cypress.impl.ts. I had to manually revert cypress.impl.ts to make it work again for my Storybook 6.5.

@FrozenPandaz FrozenPandaz added scope: testing tools Issues related to Cypress / Jest / Playwright / Vitest support in Nx scope: storybook Issues related to Storybook support in Nx labels Jan 18, 2023
@mandarini
Copy link
Member

Ok I'm on it. I was pretty sure I fixed it but I guess not!

@deegansiwicki
Copy link
Author

Ok I'm on it. I was pretty sure I fixed it but I guess not!

Get this when trying to install storybook now.

Screenshot 2023-01-25 at 9 31 24 AM

@mandarini
Copy link
Member

mandarini commented Jan 25, 2023

Can you send me the steps you followed, exactly, please? Also, can you please send me a reproduction repository? @deegansiwicki

@bosycom
Copy link

bosycom commented Jan 25, 2023

@deegansiwicki I had something similar lately. In my case the version was set to 0.0.0 and so I got the same message. I don't know how or why, but I fixed it by restoring a previous version of my package.json. Your package.json was also probably messed with and should be reverted if you can, preferably by comparing which dependency was set to undefined.

@deegansiwicki
Copy link
Author

@deegansiwicki I had something similar lately. In my case the version was set to 0.0.0 and so I got the same message. I don't know how or why, but I fixed it by restoring a previous version of my package.json. Your package.json was also probably messed with and should be reverted if you can, preferably by comparing which dependency was set to undefined.

Thank you, I will give it a look.

@mandarini
Copy link
Member

Just a general tip. When you're upgrading, always use nx migrate! :D

@deegansiwicki
Copy link
Author

Just a general tip. When you're upgrading, always use nx migrate! :D

I use pnpm exec or yarn exec nx migrate latest. Is that wrong?

@mandarini
Copy link
Member

That's perfect!

@deegansiwicki
Copy link
Author

That's perfect!

Ok thank you.

@github-actions
Copy link

github-actions bot commented Mar 3, 2023

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated scope: storybook Issues related to Storybook support in Nx scope: testing tools Issues related to Cypress / Jest / Playwright / Vitest support in Nx type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants