event-catalog / eventcatalog

An open source documentation tool to bring discoverability to your event-driven architectures
https://eventcatalog.dev
MIT License
1.64k stars 135 forks source link

Build error related to Mermaid in /events & /services in default demo #507

Closed LarsArtmann closed 4 months ago

LarsArtmann commented 4 months ago

Have you read the Contributing Guidelines on issues?

Description

Description

npm run build and docker build image-name and npm run dev + Open /events or /services do not work.

Error

0 60.90 ../node_modules/mermaid/dist/mindmap-definition-0ab67801.js

0 60.90 Module not found: Package path ./dist/cytoscape.umd.js is not exported from package /app/node_modules/cytoscape (see exports field in /app/node_modules/cytoscape/package.json)

0 60.90

0 60.90 Import trace for requested module:

0 60.90 ../node_modules/mermaid/dist/mindmap-definition-0ab67801.js

0 60.90 ../node_modules/mermaid/dist/mermaid-a98f434b.js

0 60.90 ../node_modules/mermaid/dist/mermaid.core.mjs

0 60.90 ./components/Mermaid/index.tsx

0 60.90

0 60.90

0 60.90 > Build failed because of webpack errors

0 60.99 Error: Command failed: cross-env PROJECT_DIR='/app' npm run build

0 60.99 at checkExecSyncError (node:child_process:861:11)

0 60.99 at execSync (node:child_process:932:15)

0 60.99 at Command. (/app/node_modules/@eventcatalog/core/bin/eventcatalog.js:67:5)

0 60.99 at Command.listener [as _actionHandler] (/app/node_modules/commander/index.js:922:31)

0 60.99 at Command._parseCommand (/app/node_modules/commander/index.js:1503:14)

0 60.99 at Command._dispatchSubcommand (/app/node_modules/commander/index.js:1443:18)

0 60.99 at Command._parseCommand (/app/node_modules/commander/index.js:1460:12)

0 60.99 at Command.parse (/app/node_modules/commander/index.js:1292:10)

0 60.99 at run (/app/node_modules/@eventcatalog/core/bin/eventcatalog.js:128:7) {

0 60.99 status: 1,

0 60.99 signal: null,

0 60.99 output: [ null, null, null ],

0 60.99 pid: 49,

0 60.99 stdout: null,

0 60.99 stderr: null

0 60.99 }

Steps to reproduce

  1. npx @eventcatalog/create-eventcatalog@latest my-catalog
  2. npm run build

Expected behavior

Not crash

Actual behavior

Crash

Your environment

LarsArtmann commented 4 months ago

mermaid needs cytoscape@3.28.1 but is not to strickt with the version. 4 hours ago cytoscape@3.29.0 was released. if you downgrade cytoscape@3.29.0 for mermaid back to cytoscape@3.28.1 it works again

LarsArtmann commented 4 months ago

cytoscape stoped supporting umd.js in 3.29.0

https://github.com/cytoscape/cytoscape.js/compare/3.28.x...unstable

LarsArtmann commented 4 months ago

For everybody who wants a quick fix

Add: "cytoscape": "3.28.1" to your dependencies in package.json and run npm i

boyney123 commented 4 months ago

Thank you for raising this!

I updated the version of mermaid to the latest minor version, this seemed to have fixed the issue. Thank you for raising the issue!