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

Script error when using unpkg/react-markdown@5.0.2 #506

Closed
doveccl opened this issue Nov 12, 2020 · 5 comments
Closed

Script error when using unpkg/react-markdown@5.0.2 #506

doveccl opened this issue Nov 12, 2020 · 5 comments
Labels
💪 phase/solved Post is done

Comments

@doveccl
Copy link
Contributor

doveccl commented Nov 12, 2020

Just create simple html file to test

<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Test</title>
</head>
<body>
  <script src="https://unpkg.com/react-markdown@5.0.2"></script>
</body>
</html>

An error shows

Uncaught ReferenceError: module is not defined
    at react-markdown.min.js:15
@doveccl doveccl added 🐛 type/bug This is a problem 🙉 open/needs-info This needs some more info labels Nov 12, 2020
@ChristianMurphy
Copy link
Member

looks to be related to

format: 'cjs',

we may need an iife or umd version for legacy browsers, and/or es for modern browsers.

@ChristianMurphy
Copy link
Member

@doveccl would you be interested in opening a PR?

@doveccl
Copy link
Contributor Author

doveccl commented Nov 19, 2020

@ChristianMurphy
#510
is it ok?

@wooorm
Copy link
Member

wooorm commented Nov 19, 2020

Have you tried it out locally? npm install && npm test, that should give you a file, which you can load with your HTML above. Does that work?

@doveccl
Copy link
Contributor Author

doveccl commented Nov 19, 2020

@wooorm it works fine on my browser

@wooorm wooorm closed this as completed in 3d363e9 Nov 19, 2020
@wooorm wooorm added ⛵️ status/released and removed 🐛 type/bug This is a problem 🙉 open/needs-info This needs some more info labels Apr 12, 2021
@wooorm wooorm added the 💪 phase/solved Post is done label Aug 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💪 phase/solved Post is done
Development

No branches or pull requests

3 participants