[Bug]: use of isomorphic-unfetch breaks storybook-next build
- 主要语言
- JavaScript
- 星标
- 5.7k
- 派生
- 204
- PR 合并指标
- 30 天内没有已合并 PR
描述
We're experiencing a problem using `isomorphic-unfetch` in `storybook` together with `nextjs`. Even though it works fine in the `next` build, importing `isomorphic-unfetch` in a component in `storybook` causes several errors.
```
Module not found: Error: Can't resolve 'unfetch' in '/Users/martaver/Projects/repro/node_modules/isomorphic-unfetch'
```
and several of:
```
Module build failed: UnhandledSchemeError: Reading from "node:buffer" is not handled by plugins (Unhandled scheme).
Webpack supports "data:" and "file:" URIs by default.
You may need an additional plugin to handle "node:" URIs.
```
I've documented the problem and provided a full repro in the `storybook` repo, since it seems to be caused by a difference between how `storybook` and `next` are built, but I thought I'd also flag the issue here, in case the authors might have some insight:
https://github.com/storybookjs/storybook/issues/23700
贡献指南
这个仓库没有索引到贡献指南
调研方向
从链接的 Storybook issue 及其完整复现开始,然后比较组件 import isomorphic-unfetch 时的 Storybook 和 Next.js 构建结果。该 issue 没有列出文件或测试;要算完成,需要确定构建不兼容问题,并确认修复方案或兼容性结果。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript, nextjs, storybook
- 领域
- build-system, tooling
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 25/100