testing with create-react-app
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- javascript, react
调研方向
使用 create-react-app 测试命令重现该失败,并检查从 src/App.test.js 经过 src/App.js、src/container/GraphContainer.js、src/components/Graph/index.js 到 src/components/Graph/StyledGraph.js 的堆栈。将 Plotly 的导入和 react-plotly.js factory 的使用方式与 jsdom 测试环境进行比较。默认渲染测试能够在不出现与 document 相关的错误的情况下运行,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Hi! Thanks for all the good work.
I am trying to make the simple test that comes with create-react-app to work. (Which checks whole app renders without a crash)
I get an error like below.
TypeError: Cannot read property 'document' of undefined
at node_modules/plotly.js/dist/plotly.js:74:22
at node_modules/plotly.js/dist/plotly.js:9620:2
at Object.<anonymous>._$numerical_517.BADNUM (node_modules/plotly.js/dist/plotly.js:7:88)
at Object.<anonymous> (node_modules/plotly.js/dist/plotly.js:7:327)
at Object.<anonymous> (node_modules/react-plotly.js/react-plotly.js:11:15)
at Object.<anonymous> (src/components/Graph/StyledGraph.js:2:20)
at Object.<anonymous> (src/components/Graph/index.js:4:20)
at Object.<anonymous> (src/container/GraphContainer.js:6:14)
at Object.<anonymous> (src/App.js:7:23)
at Object.<anonymous> (src/Main.js:14:12)
at Object.<anonymous> (src/App.test.js:5:13)
I am using pretty much the default command that comes with create-react-app. (Test command node scripts/test.js --env=jsdom, react-app-preset)
import Plotly from 'plotly.js/dist/basic';
I am using Plotly like below.
import Plotly from 'plotly.js/dist/basic';
import createPlotlyComponent from 'react-plotly.js/factory';
const Plot = createPlotlyComponent(Plotly);
- 主要语言
- JavaScript
- 星标
- 1.1k
- 派生
- 138
- 平均合并
- 3 天 2 小时
- 30 天内合并 PR
- 4
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
plotly/react-plotly.js 的其他 Issue
-
P3 plotly-internal size: 1 task
难度 3/5 1-2 天 新手友好度 45/100
plotly/react-plotly.js#386 ·
-
enhancement P3 size: 1
难度 3/5 1-2 天 新手友好度 65/100
plotly/react-plotly.js#380 · 7 条评论 ·
-
难度 4/5 3-5 天 新手友好度 48/100
plotly/react-plotly.js#358 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 35/100
plotly/react-plotly.js#354 ·
-
难度 3/5 1-2 天 新手友好度 30/100
plotly/react-plotly.js#353 · 1 条评论 ·
查看 plotly/react-plotly.js 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
avniproject/avni-client#2135 ·
-
automated broken-link
难度 1/5 1 小时以内 新手友好度 85/100
-
agent/security hive/hosted-available-lke648397-260827-5n31 security
难度 2/5 1-3 小时 新手友好度 84/100
-
enhancement
难度 2/5 1-3 小时 新手友好度 70/100
babalae/bettergi-scripts-list#3674 ·
-
A-Release-Notes C-Editing D-Modest S-Ready-For-Implementation
难度 2/5 1-3 小时 新手友好度 72/100
bevyengine/bevy-website#2595 ·