React Storybook 3.3.15中Actions面板不显示问题求助
Let's troubleshoot this step by step since you're working with older versions of Storybook and Node, which can have specific compatibility quirks:
1. Verify Addon Version Compatibility
Storybook 3.3.15 requires a specific version of @storybook/addon-actions to work properly—newer versions won’t be compatible with this older Storybook release. Uninstall your current addon version and install the matching 2.x release:
npm uninstall @storybook/addon-actions npm install @storybook/addon-actions@2.0.2 --save-dev
2. Double-Check Your .storybook/addons.js File
Make sure the file is located exactly in the .storybook directory at your project root, and its content is only:
import '@storybook/addon-actions/register';
Watch for typos (like missing slashes or incorrect casing—even though Windows is case-insensitive, Node’s module resolution can be picky with older versions).
3. Clean Dependencies and Cache
Older Node/npm versions are prone to cache or dependency corruption. Try a full reset:
- Delete your
node_modulesfolder andpackage-lock.json(ornpm-shrinkwrap.json):rd /s /q node_modules del package-lock.json - Clear the npm cache:
npm cache clean --force - Reinstall all dependencies:
npm install - Restart your Storybook server completely.
4. Confirm Storybook Uses the Correct Config Directory
Ensure your start command points to the right .storybook folder. If you’re using a custom path, specify it explicitly:
start-storybook -c .storybook
Without the -c flag, Storybook might look for config files in an unexpected location.
5. Check Network Requests in Browser DevTools
Open your browser’s DevTools (F12), go to the Network tab, and filter for JS files. Look for requests related to addon-actions—a 404 error here means the addon isn’t loading properly (even if the console shows no explicit errors), pointing to a path issue in addons.js or a broken dependency install.
内容的提问来源于stack exchange,提问作者darKnight

