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

Can't open storybook with vite #127

Closed
Angry-Sparrow opened this issue Oct 26, 2021 · 7 comments
Closed

Can't open storybook with vite #127

Angry-Sparrow opened this issue Oct 26, 2021 · 7 comments

Comments

@Angry-Sparrow
Copy link

Everything I've done:
npm init vite
npx sb@next init --builder storybook-builder-vite
npm run storybook

image

package.json

{
  "name": "react-ts",
  "version": "0.0.0",
  "scripts": {
    "dev": "vite",
    "build": "tsc && vite build",
    "serve": "vite preview",
    "storybook": "start-storybook -p 6006",
    "build-storybook": "build-storybook"
  },
  "dependencies": {
    "react": "^17.0.0",
    "react-dom": "^17.0.0"
  },
  "devDependencies": {
    "@babel/core": "^7.15.8",
    "@storybook/addon-actions": "^6.4.0-beta.20",
    "@storybook/addon-essentials": "^6.4.0-beta.20",
    "@storybook/addon-links": "^6.4.0-beta.20",
    "@storybook/react": "^6.4.0-beta.20",
    "@types/react": "^17.0.0",
    "@types/react-dom": "^17.0.0",
    "@vitejs/plugin-react": "^1.0.0",
    "babel-loader": "^8.2.3",
    "storybook-builder-vite": "^0.1.2",
    "typescript": "^4.3.2",
    "vite": "^2.6.4"
  }
}

What went wrong?

@SamuelAlev
Copy link

Seems linked to this:
algolia/react-element-to-jsx-string#662

Quick fix: npm i [email protected]

@Angry-Sparrow
Copy link
Author

Seems linked to this: algolia/react-element-to-jsx-string#662

Quick fix: npm i [email protected]

I tried.
I even found ForwardRef in the source code.
But it didn't work.

@SQReder
Copy link

SQReder commented Oct 26, 2021

Seems linked to this: algolia/react-element-to-jsx-string#662

Quick fix: npm i [email protected]

Doesn't work for me either

@Angry-Sparrow
Copy link
Author

If I don't build with vite, everthing is normal.

  "core": {
    // "builder": "storybook-builder-vite"
  }

@IanVS
Copy link
Member

IanVS commented Oct 26, 2021

Could you please try this? #119 (comment)

We need to release a new version and then you should be able to remove it again.

@SQReder
Copy link

SQReder commented Oct 26, 2021

Could you please try this? #119 (comment)

We need to release a new version and then you should be able to remove it again.

Yep, this works.

Offtopic: I've temporarily switched back to webpack and then to vite again. And daaaaaamn! Vite is damn blazing fast!

@IanVS
Copy link
Member

IanVS commented Oct 26, 2021

I've released v0.1.3 which should fix this issue. Feel free to upgrade and remove react-is and @base2/pretty-print-object from your optimizeDeps.include.

@IanVS IanVS closed this as completed Oct 26, 2021
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

4 participants