Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to compile with mermaid 11.4.1 #6107

Open
kevin-james-sp opened this issue Dec 3, 2024 · 1 comment
Open

Unable to compile with mermaid 11.4.1 #6107

kevin-james-sp opened this issue Dec 3, 2024 · 1 comment
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect

Comments

@kevin-james-sp
Copy link

Description

Upgraded a project using mermaid 10.9.3 to mermaid 11.4.1. It then refused to compile with the following error:

node_modules/@antfu/utils/dist/index.d.ts:591:5 - error TS2416: Property 'then' in type 'PInstance<T>' is not assignable to the same property in base type 'Promise<Awaited<T>[]>'.
  Type '(fn?: () => PromiseLike<any>) => Promise<any>' is not assignable to type '<TResult1 = Awaited<T>[], TResult2 = never>(onfulfilled?: (value: Awaited<T>[]) => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<...>) => Promise<...>'.
    Types of parameters 'fn' and 'onfulfilled' are incompatible.
      Target signature provides too few arguments. Expected 1 or more, but got 0.

591     then(fn?: () => PromiseLike<any>): Promise<any>;
        ~~~~

Unable to find the problem, I created a simple test case. Maybe I'm using the wrong version of something somewhere.

Steps to reproduce

Node v20.17.0
package.json

{
  "name": "mermaidtest",
  "version": "1.0.0",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "description": "",
  "dependencies": {
    "mermaid": "^11.4.1"
  },
  "type": "module",
  "devDependencies": {
    "@types/node": "^20.12.10",
    "ts-jest": "^29.2.5",
    "ts-node": "^10.9.2",
    "typescript": "^5.7.2"
  }
}

test.ts

import mermaid from "mermaid";

console.log('end');

After running npm i, Running npx tsc test.ts give the same error as above.

Screenshots

No response

Code Sample

No response

Setup

  • Mermaid version:
  • Browser and Version: [Chrome, Edge, Firefox]

Suggested Solutions

No response

Additional Context

No response

@kevin-james-sp kevin-james-sp added Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect labels Dec 3, 2024
@kut
Copy link

kut commented Dec 10, 2024

I get the same in v11.4.0, but not when I downgrade to 10.9.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect
Projects
None yet
Development

No branches or pull requests

2 participants