storybookjs / storybook

Storybook is the industry standard workshop for building, documenting, and testing UI components in isolation
https://storybook.js.org
MIT License
83.99k stars 9.23k forks source link

npm link a module but can't be find #18653

Open deyinliu opened 2 years ago

deyinliu commented 2 years ago

Describe the bug i developed a packkageName module in local, and npm link packageName in storybook project, first start-storybook is success, but after i update the custom packageName, the commandline show Cannot find module 'packageName', then i refresh browse, there is no error

System Storybook 6.5.9 for React started node v16.15.1 npm 8.6.0 macOS 12.4 package.json

{
  "private": true,
  "name": "web-app-sdk-example",
  "version": "0.1.0",
  "dependencies": {
    "@mdx-js/react": "^2.1.2",
    "@packkageName": "*",
    "@storybook/addon-console": "^1.2.3",
    "@testing-library/jest-dom": "^5.16.4",
    "@testing-library/react": "^13.3.0",
    "@testing-library/user-event": "^13.5.0",
    "@types/jest": "^27.5.2",
    "@types/mdx": "^2.0.2",
    "@types/node": "^16.11.43",
    "@types/react": "^18.0.14",
    "@types/react-dom": "^18.0.5",
    "eslint-config-prettier": "^8.5.0",
    "eslint-import-resolver-typescript": "^3.2.1",
    "eslint-plugin-import": "^2.26.0",
    "eslint-plugin-mdx": "^2.0.1",
    "eslint-plugin-prettier": "^4.2.1",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-scripts": "5.0.1",
    "typescript": "^4.7.4",
    "web-vitals": "^2.1.4"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject",
    "book": "start-storybook -p 6006 -s public",
    "build-book": "build-storybook -s public"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ],
    "overrides": [
      {
        "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.9",
    "@storybook/addon-essentials": "^6.5.9",
    "@storybook/addon-interactions": "^6.5.9",
    "@storybook/addon-links": "^6.5.9",
    "@storybook/addon-storysource": "^6.5.9",
    "@storybook/builder-webpack5": "^6.5.9",
    "@storybook/manager-webpack5": "^6.5.9",
    "@storybook/node-logger": "^6.5.9",
    "@storybook/preset-create-react-app": "^4.1.2",
    "@storybook/react": "^6.5.9",
    "@storybook/testing-library": "^0.0.13",
    "babel-plugin-named-exports-order": "^0.0.2",
    "prop-types": "^15.8.1",
    "webpack": "^5.73.0"
  }
}
MartinMasek commented 1 year ago

I have the same use case, did you solve it?