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]: win10下, 启用可选功能, 启动Storybook V7 出错 #5477

Open
wangjue666 opened this issue Feb 29, 2024 · 7 comments
Open

[Bug]: win10下, 启用可选功能, 启动Storybook V7 出错 #5477

wangjue666 opened this issue Feb 29, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@wangjue666
Copy link

wangjue666 commented Feb 29, 2024

版本信息

System:
    OS: Windows 10 10.0.19045
    CPU: (12) x64 AMD Ryzen 5 3600 6-Core Processor
    Memory: 5.52 GB / 15.95 GB
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (119.0.2151.72)
    Internet Explorer: 11.0.19041.1566

问题详情

image

λ  pnpm run storybook

> myapp@0.1.0 storybook E:\test\myapp
> storybook dev -p 6006

@storybook/cli v7.6.17

SB_CORE-COMMON_0003 (CouldNotEvaluateFrameworkError): Could not evaluate the '@modern-js/storybook' package from the 'framework' field of Storybook config.

Are you sure it's a valid package and is installed?
    at validateFrameworkName (.\node_modules\.pnpm\@storybook+core-common@7.6.17\node_modules\@storybook\core-common\dist\index.js:21:4479)
    at buildDevStandalone (.\node_modules\.pnpm\@storybook+core-server@7.6.17\node_modules\@storybook\core-server\dist\index.js:119:1432)
    at async withTelemetry (.\node_modules\.pnpm\@storybook+core-server@7.6.17\node_modules\@storybook\core-server\dist\index.js:65:3948)
    at async dev (.\node_modules\.pnpm\@storybook+cli@7.6.17\node_modules\@storybook\cli\dist\generate.js:514:401)
    at async Command.<anonymous> (.\node_modules\.pnpm\@storybook+cli@7.6.17\node_modules\@storybook\cli\dist\generate.js:529:225)

WARN Broken build, fix the error above.
WARN You may need to refresh the browser.

× Would you like to help improve Storybook by sending anonymous crash reports? ... yes

复现链接

复现步骤


npx @modern-js/create@latest myapp

? 请选择你想创建的工程类型 Npm 模块
- Load Generator...(node:16268) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit
(Use `node --trace-warnings ...` to show where the warning was created)
? 请填写项目名称 myapp
? 请选择开发语言 TS
? 请选择包管理工具 pnpm

cd myapp

pnpm run new

> modern new

  Modern.js Module v2.47.1

? 请选择你想要的操作 启用可选功能
? 请选择功能名称 启用「Storybook」V7


pnpm run storybook

参考文档 https://modernjs.dev/module-tools/guide/basic/using-storybook.html

@wangjue666 wangjue666 added the bug Something isn't working label Feb 29, 2024
@9aoy
Copy link
Collaborator

9aoy commented Mar 4, 2024

image

Did you see the above success words or get an error when executing run new?

By the way, I have not reproduced this problem in modern.js 2.48.0. You can try upgrading to the latest version.

@kirainmoe
Copy link
Contributor

This could be reproduced on Windows.

But I thought that it was a problem of storybook itself, because it was resolving third-party framework preset (i.e. frameworks not in its official whitelist) with a form like require.resolve(path.join(frameworkName, “presets”)). On Windows it will resolve @modern-js\storybook\presets and throw an error.

A possible solution is to run storybook under WSL.

@wangjue666
Copy link
Author

image Did you see the above success words or get an error when executing run new?

By the way, I have not reproduced this problem in modern.js 2.48.0. You can try upgrading to the latest version.

@9aoy 刚刚重试试了下,是2.48.0版本还是不可以,我的是window10系统

image

@wangjue666
Copy link
Author

This could be reproduced on Windows.

But I thought that it was a problem of storybook itself, because it was resolving third-party framework preset (i.e. frameworks not in its official whitelist) with a form like require.resolve(path.join(frameworkName, “presets”)). On Windows it will resolve @modern-js\storybook\presets and throw an error.

A possible solution is to run storybook under WSL.

哥,能否使用 patch-package 这样的工具进行修改下storybook的白名单?好在windows上进行使用

@wangjue666 wangjue666 changed the title [Bug]: 启用可选功能, 启动Storybook V7 出错 [Bug]: win10下, 启用可选功能, 启动Storybook V7 出错 Mar 5, 2024
@10Derozan
Copy link
Member

Can you provide a repo? Maybe the reason is that you have not installed @modern-js/storybook?

@wangjue666
Copy link
Author

Can you provide a repo? Maybe the reason is that you have not installed @modern-js/storybook?

@10Derozan I am confident that I have installed it. here is repo, https://github.com/wangjue666/myapp

image

@h7ml
Copy link

h7ml commented Apr 15, 2024

Encountered the same problem with log information

> calendar@0.1.0 storybook \calendar
> storybook dev -p 6006

@storybook/cli v7.6.17

(node:23596) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
SB_CORE-COMMON_0003 (CouldNotEvaluateFrameworkError): Could not evaluate the '@modern-js/storybook' package from the 'framework' field of Storybook config.

Are you sure it's a valid package and is installed?
    at validateFrameworkName (.\node_modules\.pnpm\@storybook+core-common@7.6.17\node_modules\@storybook\core-common\dist\index.js:21:4479)
    at buildDevStandalone (.\node_modules\.pnpm\@storybook+core-server@7.6.17\node_modules\@storybook\core-server\dist\index.js:119:1432)
    at async withTelemetry (.\node_modules\.pnpm\@storybook+core-server@7.6.17\node_modules\@storybook\core-server\dist\index.js:65:3948)
    at async dev (.\node_modules\.pnpm\@storybook+cli@7.6.17\node_modules\@storybook\cli\dist\generate.js:514:401)
    at async Command.<anonymous> (.\node_modules\.pnpm\@storybook+cli@7.6.17\node_modules\@storybook\cli\dist\generate.js:529:225)

WARN Broken build, fix the error above.
WARN You may need to refresh the browser.

 ELIFECYCLE  Command failed with exit code 1.

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

5 participants