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

Support Marked 9.0 #561

Closed
ilianiv opened this issue Sep 11, 2023 · 7 comments
Closed

Support Marked 9.0 #561

ilianiv opened this issue Sep 11, 2023 · 7 comments
Labels

Comments

@ilianiv
Copy link

ilianiv commented Sep 11, 2023

Describe the bug
An error occurs when used with marked >=8.0

Error: node_modules/easymde/types/easymde.d.ts:103:32 - error TS2694: Namespace '"marked".marked' has no exported member 'MarkedOptions'.

103         markedOptions?: marked.MarkedOptions;
@ilianiv ilianiv added the Bug label Sep 11, 2023
@Ionaru
Copy link
Owner

Ionaru commented Sep 15, 2023

That's odd, they didn't mention any type changes in their changelog... https://github.com/markedjs/marked/releases/tag/v9.0.0

@Ionaru Ionaru closed this as completed Sep 15, 2023
@Ionaru Ionaru reopened this Sep 15, 2023
@Ionaru
Copy link
Owner

Ionaru commented Sep 15, 2023

I'll try and find out what changed.

@Viktor-Ivliev
Copy link

Viktor-Ivliev commented Jan 29, 2024

Version 11.2.0 has already been released and this problem has not been solved.
You need to replace
https://github.com/Ionaru/easy-markdown-editor/blob/master/types/easymde.d.ts
import { marked } from 'marked'; -> import { marke, MarkedOptions } from 'marked';

https://github.com/Ionaru/easy-markdown-editor/blob/master/types/easymde.d.ts#L104
markedOptions?: MarkedOptions;

or freeze at the maximum supported version

P.S:// as well as there were changed ways of adding rendering, but also post-processing options were added

@Viktor-Ivliev
Copy link

It's not broken in version 9, it's been broken since version 6.

@RLain
Copy link

RLain commented May 21, 2024

Also getting the same issue:

Error: node_modules/easymde/types/easymde.d.ts:103:32 - error TS2694: Namespace '"redacted/node_modules/marked/lib/marked".marked' has no exported member 'MarkedOptions'.

103         markedOptions?: marked.MarkedOptions;
                                   ~~~~~~~~~~~~~

Also compiles with this change:

import { marked, MarkedOptions } from 'marked';
...etc
    interface RenderingOptions {
        codeSyntaxHighlighting?: boolean;
        hljs?: any;
        markedOptions?: MarkedOptions;
        sanitizerFunction?: (html: string) => string;
        singleLineBreaks?: boolean;
    }

@Viktor-Ivliev
Copy link

@Ionaru ping

@Ionaru
Copy link
Owner

Ionaru commented Jun 7, 2024

or freeze at the maximum supported version

The marked dependency is already set to ^4.1.0, which means any version after that is unsupported. If there's a need to change the settings or renderer, I suggest matching the version.

image


I have tried to upgrade the version of marked, but ran into issues with modern JS syntax that the build system (Gulp, or a plugin) doesn't understand. Specifically a syntax error for a # marking a private method.

[12:43:56] SyntaxError: Unexpected token (2298:8) while parsing C:\Users\Jeroen\Projects\easy-markdown-editor\node_modules\marked\lib\marked.umd.js while parsing file: C:\Users\Jeroen\Projects\easy-markdown-editor\node_modules\marked\lib\marked.umd.js
    at DestroyableTransform.end [as _flush] (C:\Users\Jeroen\Projects\easy-markdown-editor\node_modules\insert-module-globals\index.js:114:21)
    at DestroyableTransform.prefinish (C:\Users\Jeroen\Projects\easy-markdown-editor\node_modules\readable-stream\lib\_stream_transform.js:138:10)
    at DestroyableTransform.emit (node:events:514:28)
    at DestroyableTransform.emit (node:domain:551:15)
    at prefinish (C:\Users\Jeroen\Projects\easy-markdown-editor\node_modules\readable-stream\lib\_stream_writable.js:619:14)
    at finishMaybe (C:\Users\Jeroen\Projects\easy-markdown-editor\node_modules\readable-stream\lib\_stream_writable.js:627:5)
    at endWritable (C:\Users\Jeroen\Projects\easy-markdown-editor\node_modules\readable-stream\lib\_stream_writable.js:638:3)
    at Writable.end (C:\Users\Jeroen\Projects\easy-markdown-editor\node_modules\readable-stream\lib\_stream_writable.js:594:41)
    at DestroyableTransform.onend (C:\Users\Jeroen\Projects\easy-markdown-editor\node_modules\readable-stream\lib\_stream_readable.js:577:10)
    at Object.onceWrapper (node:events:628:28)

image


Because replacing the build system is not something easily done, and the supported version of marked is already set to ^4.1.0, I'm going to close this as 'not planned' and add a requirement to #447.

@Ionaru Ionaru mentioned this issue Jun 7, 2024
@Ionaru Ionaru closed this as not planned Won't fix, can't repro, duplicate, stale Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants