Closed kernwig closed 1 year ago
🤔 The second error is unrelated. That one appears to be related to upgrading to SST v2, which I used to deploy the catalog to AWS.
May be due to SST v2 depending on React v18, while EventCatalog depends on React v17.
Workaround: Run this as an npm "postinstall" script:
"use strict";
console.log("\n** Patching EventCatalog to work with TypeScript v5 **\n\n");
const files = [
".eventcatalog-core/components/Mdx/NodeGraph/GraphLayout.ts",
"../node_modules/@eventcatalog/core/components/Mdx/NodeGraph/GraphLayout.ts",
];
const origContent = "if (element.style.width <= nodeDefaultWidth) {";
const newContent = "if (Number(element.style.width) <= nodeDefaultWidth) {";
const fs = require("node:fs");
for (const filePath of files) {
if (fs.existsSync(filePath)) {
const fileContent = fs.readFileSync(filePath).toString();
fs.writeFileSync(filePath, fileContent.replace(origContent, newContent));
}
}
Thanks for the work around. I've created a PR here. https://github.com/boyney123/eventcatalog/pull/414
Hi @pebbz and @kernwig, what's the latest on this issue?
@boyney123 Any chance this PR can be approved?
Sorry folks, just catching up now, thank you @pebbz (again!), this has been merged. Enjoy!
Have you read the Contributing Guidelines on issues?
Description
EventCatalog-core has multiple tanspilation problems when used with TypeScript 5.0. My entire mono-repo is stuck on the outdated TypeScript v4.9 due to this.
When I resolve the above (by wrapping
element.style.width
inNumber()
, then this error appears next:Steps to reproduce
Include EventCatalog in a project using TypeScript v5.0.4. and
eventcatalog build
Expected behavior
Builds and runs properly with TypeScript v5.
Actual behavior
Will not compile.
Your environment