简体   繁体   English

Cube.js React Hook React.useCallback 缺少一个依赖项:'pivotConfig'。 +

[英]Cube.js React Hook React.useCallback has a missing dependency: 'pivotConfig'. +

I've been trying to create a simple dashboard with Cube.js using windows 10 and Mysql version 8.我一直在尝试使用 windows 10 和 Mysql 版本 8 使用 Cube.js 创建一个简单的仪表板。

I originally tried a Js backend, fought with the install for a few days, then tried a docker install but quit after a few hours of error messages, and now am back to the node.js backend.我最初尝试了一个 Js 后端,安装了几天,然后尝试了 docker 安装,但在几个小时的错误消息后退出,现在又回到了 node.js 后端。 My guess is Cube.js isn't updated or maintained anymore.我的猜测是 Cube.js 不再更新或维护。

Using使用

npx cubejs-cli create ihatecubejs -d whyamIstilltrying npx cubejs-cli 创建 ihatecubejs -d 为什么amIstilltrying

I get:我得到:

 npm WARN ERESOLVE overriding peer dependency npm WARN While resolving: dashboard-app@0.1.0 npm WARN Found: react@17.0.2 npm WARN node_modules/react npm WARN peer react@"*" from @testing-library/react@11.2.7 npm WARN node_modules/@testing-library/react npm WARN @testing-library/react@"^11.2.7" from the root project npm WARN 6 more (react-dom, react-scripts, the root project, ...) npm WARN npm WARN Could not resolve dependency: npm WARN peer react@"17.0.2" from react-dom@17.0.2 npm WARN node_modules/react-dom npm WARN peer react-dom@"*" from @testing-library/react@11.2.7 npm WARN node_modules/@testing-library/react npm WARN 3 more (the root project, @ant-design/compatible, antd) npm WARN ERESOLVE overriding peer dependency npm WARN While resolving: dashboard-app@0.1.0 npm WARN Found: react@17.0.2 npm WARN node_modules/react npm WARN peer react@"*" from @testing-library/react@11.2.7 npm WARN node_modules/@testing-library/react npm WARN @testing-library/react@"^11.2.7" from the root project npm WARN 6 more (react-dom, react-scripts, the root project, ...) npm WARN npm WARN Could not resolve dependency: npm WARN peer react@"17.0.2" from react-dom@17.0.2 npm WARN node_modules/react-dom npm WARN peer react-dom@"*" from @testing-library/react@11.2.7 npm WARN node_modules/@testing-library/react npm WARN 3 more (the root project, @ant-design/compatible, antd) npm WARN ERESOLVE overriding peer dependency npm WARN While resolving: dashboard-app@0.1.0 npm WARN Found: react@17.0.2 npm WARN node_modules/react npm WARN peer react@"*" from @testing-library/react@11.2.7 npm WARN node_modules/@testing-library/react npm WARN @testing-library/react@"^11.2.7" from the root project npm WARN 6 more (react-dom, react-scripts, the root project, ...) npm WARN npm WARN Could not resolve dependency: npm WARN peer react@"17.0.2" from react-dom@17.0.2 npm WARN node_modules/react-dom npm WARN peer react-dom@"*" from @testing-library/react@11.2.7 npm WARN node_modules/@testing-library/react npm WARN 3 more (the root project, @ant-design/compatible, antd) npm WARN deprecated core-js@1.2.7: core-js@<3.3 is no longer maintained and not

Then:然后:

Compile Failed-
./src/components/Header.js
Attempted import error: 'withRouter' is not exported from 'react-router'.

is fixed with:固定为:

npm install react-router@5

npm install react-router-dom@5

Then a ton of warning messages (one being deprecated UUID (version 3.4)- it's not installed though) that are ignored.然后是一吨被忽略的警告消息(一个被弃用的 UUID(版本 3.4)——虽然它没有安装)。

running npm start dev in the project directory opens the dev panel and running 'generate scheme' creates a scheme for each of my 2 connected databases in the "cube.js_test\ihatecubejs\schema" folder but none of the variables in the database are carried over.在项目目录中运行 npm 启动开发打开开发面板并运行“生成方案”为“cube.js_test\ihatecubejs\schema”文件夹中我的 2 个连接的数据库中的每一个创建一个方案,但数据库中没有任何变量被携带超过。

I manually enter a handful of variables in the schema and get a chart to show in the development panel.我在架构中手动输入了一些变量,并在开发面板中显示了一个图表。 A chart is generated, incorrectly, and I specify that I want time to be ordered- which throws an error but works on refresh.错误地生成了一个图表,并且我指定我想要订购时间 - 这会引发错误但在刷新时有效。 Whatever.任何。

Now to create a dashboard app with the one chart:现在使用一个图表创建仪表板应用程序:

Error: " "category" is not a registered scale."错误:““类别”不是注册比例。” or或者

装载轮确实烧坏了

The console says:控制台说:

Compiled with warnings.编译时带有警告。

src\components\ChartRenderer.js Line 78:5: React Hook React.useCallback has a missing dependency: 'pivotConfig'. src\components\ChartRenderer.js 第 78:5 行:React Hook React.useCallback 缺少依赖项:'pivotConfig'。 Either include it or remove the dependency array react-hooks/exhaustive-deps要么包含它,要么移除依赖数组 react-hooks/exhaustive-deps

But pivotConfig seems to be defined in the DashboardPage.js in the /src folder.但是 pivotConfig 似乎是在 /src 文件夹的 DashboardPage.js 中定义的。

I can't figure it out and I'm gonna barf if I spend any more time on this.我想不通,如果我再花时间在这上面,我会呕吐的。 Any help is much appreciated.任何帮助深表感谢。

I'm from the Cube dev team.我来自 Cube 开发团队。 Sorry to hear that you've had such an experience with Cube.很遗憾听到您对 Cube 有过这样的体验。

The first two preset dashboards seem to be fixed already.前两个预设仪表板似乎已经修复。 As for the others, they will be fixed soon.至于其他的,很快就会修好。 Also, it looks like we didn't have a chance to check how it works for Windows properly before.此外,看起来我们之前没有机会检查它如何正确地用于 Windows。

I would recommend using Cube in Docker.我建议在 Docker 中使用 Cube。 Please see this blog post for details.有关详细信息,请参阅此博客文章 Also, there's a migration guide.此外,还有一个迁移指南。

Alternatively, you can try Cube Cloud.或者,您可以尝试 Cube Cloud。 It's free to use for testing purposes and might be easier than using Docker.它可以免费用于测试目的,并且可能比使用 Docker 更容易。

Feel free to join us in Slack where you can get help much faster.随时加入我们的 Slack ,您可以更快地获得帮助。 Cube is definitely maintained, despite the fact that right now we are more focused on Docker and Cloud solutions.尽管现在我们更专注于 Docker 和云解决方案,但 Cube 肯定会得到维护。

As for dashboards, they seem to be fixed, I've tried them today.至于仪表板,它们似乎是固定的,我今天已经尝试过了。 And as for the Cube, they still maintain it.至于多维数据集,他们仍然维护它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM