-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Invalid synatax for mermaid.core.mjs
#4094
Comments
Might be related to #4034 |
I'm getting this when trying to update live editor.
|
I don't think so, it should try to pack locales it choose and drop that part of code. Maybe with an edited moment package while packing. With cdn and scripts, every thing is expected to be packed. Btw, I am curious why don't we choose dayjs |
Moment is an old dependency. Moment isn't a major dependency and we're open to replace it as long as the functionality isn't affected. |
I have reverted to |
👍 Agree, that we should replace
I've actually got a proof-of-concept commit here: aloisklink@3964cc5. The current major issue seems to be that This causes issues with daylight savings, as those days have 23/25 hours. Most annoyingly, it seems to depend on daylight savings on your PC, so What we could do is maybe use |
@aloisklink, was that the only issue? Did all the unit tests pass? Many of them failed for me with dates being different ~15days. Also, please add a unit test for the issue you identified if it's not already covered. |
It worked in some cases, at least the final code is correct, bu tai still met js heap out of space so there are still memory leak in it. |
Can you share a reproduction for the memory issues? During runtime, the memory footprint was actually smaller for 9.4 than 9.3 |
Yep, that was the only issue. One unit test failed, but that was because I'm in a region that currently follows daylight savings, and a unit test went across a daylight savings boundary. One difference with E.g. const a = moment("2020-01-01");
a.add(1, "day");
console.log(a); // 2020-01-02
const b = dayjs("2020-01-01");
const c = b.add(1, "day"); // does not change b, since dayjs objects are immutable
console.log(b); // 2020-01-01
console.log(c); // 2020-01-02
I had a quick try, but unfortunately, this issues depends on the timezone of the PC that is running the unit tests. Setting We could add a CI action that runs the tests with a custom timezone, but that seems like a lot of effort, so I'm not 100% sure if it's worth it. |
Yeah, not worth the effort, then. |
But then again, you're right, we do need to somehow test for daylight savings issues (even if it's just a manual test). Maybe we need to make a new issue called "Removing
I can have a look. I've made PRs to dayjs before (for a different daylight savings issue), and the dayjs code is really hard to work with. It's basically written pre-minified to save space, so all object properties have single character names, like Considering that the issue has been open for 2 years, it might not be the easiest fix in the world. My gut feeling is to just use a |
@aloisklink , oops! I meant a PR in mermaid with your changes containing dayjs. 😅 |
Description
When using extension
mjs
, we are working under es module, which file extension is required.However, the following code appears in dist filei:
So I am getting an error log with webpack:
Steps to reproduce
...
Screenshots
No response
Code Sample
No response
Setup
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: