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

[Bug] Storybook preset function getReactScriptsPath has bug #258

Open
PeterJSung opened this issue Jun 19, 2022 · 2 comments
Open

[Bug] Storybook preset function getReactScriptsPath has bug #258

PeterJSung opened this issue Jun 19, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@PeterJSung
Copy link

Describe the bug

hello. i used pnpm with storybook.

I use CI CD with github action when story book build. detail command like that.

command:
pnpm run build-storybook
package.json:

  "scripts": {

    "storybook": "start-storybook -p 6006 -s public",
    "build-storybook": "build-storybook -s public",
  },

in this case when i execute above command, only success in win32, and failed ubuntu in github action

log is difference both win32 and ubuntu

Win32 or Ubuntu with npm
info => Loading Webpack configuration from 'node_modules/.bin/react-script'
only Ubuntu with pnpm
info => Loading Webpack configuration from 'node_modules'

when i check this log, i find above log getReactScriptsPath.

could you please check why this command failed when i execute with pnpm in ubuntu??

.storybook/main.js

module.exports = {
  "stories": [
    "../src/**/*.stories.mdx",
    "../src/**/*.stories.@(js|jsx|ts|tsx)"
  ],
  "addons": [
    "@storybook/addon-links",
    "@storybook/addon-essentials",
    "@storybook/addon-interactions",
    "@storybook/preset-create-react-app"
  ],
  "framework": "@storybook/react",
  "core": {
    "builder": "webpack5",
  }
}

package.json

{
  "name": "frontend",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@emotion/react": "^11.9.0",
    "@emotion/styled": "^11.8.1",
    "@mui/icons-material": "^5.6.2",
    "@mui/material": "^5.6.4",
    "@reduxjs/toolkit": "^1.8.2",
    "axios": "^0.26.1",
    "immer": "^9.0.12",
    "lodash": "^4.17.21",
    "react": "^17.0.2",
    "react-dom": "^17.0.2",
    "react-kakao-maps-sdk": "^1.1.0",
    "react-redux": "^8.0.0",
    "react-router-dom": "^6.3.0",
    "react-scripts": "5.0.1",
    "redux-promise": "^0.6.0",
    "redux-thunk": "^2.4.1",
    "styled-components": "^5.3.5",
    "styled-reset": "^4.3.4",
    "typesafe-actions": "^5.1.0",
    "typescript": "^4.7.2",
    "web-vitals": "^2.1.4"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject",
    "storybook": "start-storybook -p 6006 -s public",
    "build-storybook": "build-storybook -s public",
    "pretty": "prettier --write \"./src/**/*.{ts,tsx,json,js,jsx}\""
  },
  "husky": {
    "hooks": {
      "pre-commit": "echo 'TEST'",
      "pre-push": "npm test"
    }
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ],
    "overrides": [
      {
        "files": [
          "**/*.stories.*"
        ],
        "rules": {
          "import/no-anonymous-default-export": "off"
        }
      },
      {
        "files": [
          "**/*.stories.*"
        ],
        "rules": {
          "import/no-anonymous-default-export": "off"
        }
      }
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "devDependencies": {
    "@storybook/addon-actions": "^6.5.6",
    "@storybook/addon-essentials": "^6.5.6",
    "@storybook/addon-interactions": "^6.5.6",
    "@storybook/addon-links": "^6.5.6",
    "@storybook/builder-webpack5": "^6.5.6",
    "@storybook/manager-webpack5": "^6.5.6",
    "@storybook/node-logger": "^6.5.6",
    "@storybook/preset-create-react-app": "^4.1.1",
    "@storybook/react": "^6.5.6",
    "@storybook/testing-library": "^0.0.11",
    "@testing-library/jest-dom": "^5.16.4",
    "@testing-library/react": "^12.0.0",
    "@testing-library/user-event": "^12.0.0",
    "@types/jest": "^27.5.1",
    "@types/lodash": "^4.14.182",
    "@types/node": "^16.11.36",
    "@types/react": "^18.0.9",
    "@types/react-dom": "^18.0.5",
    "@types/styled-components": "^5.1.25",
    "babel-plugin-named-exports-order": "^0.0.2",
    "prettier": "^2.6.2",
    "prop-types": "^15.8.1",
    "webpack": "^5.72.1"
  }
}

Steps to reproduce the behavior

  1. install above package.json with pnpm
  2. write command pnpm i
  3. write command pnpm run build-storybook
  4. See error

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots and/or logs

If applicable, add screenshots and/or logs to help explain your problem.

Environment

  • OS: [e.g. iOS]
  • Node.js version: [e.g. v12.17.0]
  • NPM version: [e.g. 6.14.4]
  • Browser (if applicable): [e.g. chrome, safari]
  • Browser version (if applicable): [e.g. 22]
  • Device (if applicable): [e.g. iPhone6]

Additional context

Add any other context about the problem here.

@PeterJSung PeterJSung added the bug Something isn't working label Jun 19, 2022
@unional
Copy link

unional commented Jul 6, 2022

I think this is the same as #242

For the time being, I workaround that by publishing my own package @unional/preset-create-react-app

@thedaviddias
Copy link

Any news on this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants