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

6.0 broke the build #2913

Closed
blackfalcon opened this issue Aug 1, 2023 · 5 comments · Fixed by #2916
Closed

6.0 broke the build #2913

blackfalcon opened this issue Aug 1, 2023 · 5 comments · Fixed by #2916
Labels
category: UMD L1 - broken Valid usage causes incorrect output OR a crash AND there is no known workaround for the issue

Comments

@blackfalcon
Copy link

blackfalcon commented Aug 1, 2023

Marked version:

6.0.0

Describe the bug
We've been using Marked as a CDN resource for multiple demo pages we create. With the 6.0 release, these pages stopped working.

I am not sure if there is a bug or if there is a new config consideration that I am not seeing in the docs.

Uncaught (in promise) ReferenceError: marked is not defined

To Reproduce
You can see how we use Marked in this example.
https://github.com/AlaskaAirlines/auro-alert/blob/9188f2b4cbf0f319e3ce59bfa326611ecc3c0b5e/demo/index.html#L19-L29

Again, setting the version to 5.1.0, this code renders the markdown as expected.

    <script type="module">
      import 'https://unpkg.com/marked@5.1.0/marked.min.js';
      import 'https://unpkg.com/prismjs@latest/prism.js';
      fetch('/demo/demo.md')
        .then((response) => response.text())
        .then((text) => {
          const rawHtml = marked.parse(text);
          document.querySelector('main').innerHTML = rawHtml;
          Prism.highlightAll();
        });
    </script>

Expected behavior

The markdown renders as HTML as expected.

blackfalcon added a commit to AlaskaAirlines/auro-flightline that referenced this issue Aug 2, 2023
This commit also updates the demo index.html to a fixed
version of Marked due to issues with v6.0.

markedjs/marked#2913

Changes to be committed:
modified:   demo/demo.md
modified:   demo/index.html
blackfalcon added a commit to AlaskaAirlines/auro-flightline that referenced this issue Aug 2, 2023
This commit also updates the demo index.html to a fixed
version of Marked due to issues with v6.0.

markedjs/marked#2913

Changes to be committed:
modified:   demo/demo.md
modified:   demo/index.html
@UziTech UziTech added L1 - broken Valid usage causes incorrect output OR a crash AND there is no known workaround for the issue category: UMD labels Aug 2, 2023
@UziTech
Copy link
Member

UziTech commented Aug 2, 2023

Looks like tsup doesn't create the umd build correctly

@blackfalcon
Copy link
Author

blackfalcon added a commit to AlaskaAirlines/auro-flightline that referenced this issue Aug 2, 2023
This commit also updates the demo index.html to a fixed
version of Marked due to issues with v6.0.

markedjs/marked#2913

Changes to be committed:
modified:   demo/demo.md
modified:   demo/index.html
@UziTech
Copy link
Member

UziTech commented Aug 7, 2023

This should be fixed in v7.0.1

@blackfalcon
Copy link
Author

This issue is still NOT resolved.

Screen Shot 2023-08-08 at 12 20 19 PM

@blackfalcon
Copy link
Author

Changing our configuration to the following also addresses our issues

    <script>
      fetch('/demo/demo.md')
        .then((response) => response.text())
        .then((text) => {
          const rawHtml = marked.parse(text);
          document.querySelector('main').innerHTML = rawHtml;
          Prism.highlightAll();
        });
    </script>
    <script type="module" src="../index.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/prismjs@latest/prism.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/marked@latest/marked.min.js"></script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: UMD L1 - broken Valid usage causes incorrect output OR a crash AND there is no known workaround for the issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants