-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
Property 'initialize' does not exist after upgrading to v9.2.2 #3799
Comments
Can you share more info on your build setup and a minimal reproduction if possible? |
@sidharthv96 I created demo repo:
|
// tsconfig.json
- "moduleResolution": "nodenext",
+ "moduleResolution": "node", Seems to fix the issue. |
@aloisklink @knsv, changing Also, I was checking // Webpack
const mermaid = require('mermaid');
import mermaid from 'mermaid';
// Vanilla
import mermaid from "mermaid";
let { initialize, render } = (await import("mermaid")).default; So, why don't we just remove that from package.json (in mermaid)? |
Because another package requires it. Downgrading to v9.2.1 also fix problem. |
@azat-io, I was actually talking about removing Will release |
Thanks. I'll wait v9.2.3 |
@azat-io can you try 9.2.3-rc.1 ? |
Will release 9.2.3 once the issue is confirmed to be resolved. |
@sidharthv96 I have updated mermaid to v9.2.3-rc1 and the problem is still there: |
Confirmed, I'm having the same issue. If you disable @azat-io, can you try using The new It's possible that what you're currently seeing is a bug in TypeScript, since as far as I'm aware, we're copying exactly what TypeScript recommends, and our code works correctly in Node.JS, see https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/#esm-nodejs I'm a bit unsure, TypeScript doesn't yet have the best documentation on how to make dual CommonJS/ESM packages. |
Are you considering migration to pure ESM? |
See #3590 I'm pretty for it, since it would make things a lot simpler. Currently the CommonJS version of Mermaid only works because it bundles together all dependencies (some of them, like |
Weird, I tested with the locally modified package, and it was working fine. But the release version is failing for me too. Hmm.... |
* master: doc: Add mindmap integration docs fix: Fetch depth fix: Fetch depth fix: Fetch depth fix: Add commit count to release preview fix: Add commit count to release preview chore: Add working directory fix: release-preview-publish.yml Fix #3799: Remove `type` from package.json
Issue is relevant for version v9.2.3-rc.1 |
Why the issue was closed? |
I think GitHub auto-closed it because I had the issue number in my commit message. |
I updated mermaid to v9.3.0 and issue was not fixed: Can you reopen the issue again? |
It looks like Mermaid v10 has fixed this issue, by switching to ESM-only and dropping CJS support! I've tested this with azat-io/mermaid-ts-errors-9.2.2@9169ca8, I just changed Mermaid version in the diff --git a/package.json b/package.json
index 1444aee..cd2e04d 100644
--- a/package.json
+++ b/package.json
@@ -6,7 +6,7 @@
},
"license": "ISC",
"dependencies": {
- "mermaid": "^9.3.0",
+ "mermaid": "^10.0.0",
"typescript": "^4.8.4"
}
} |
Thanks! |
Description
I'm using mermaid with dynamic import:
After updating to version 9.2.2 I get the following errors:
In version 9.2.1 everything works fine
The text was updated successfully, but these errors were encountered: