google / playground-elements

Serverless coding environments for the web.
BSD 3-Clause "New" or "Revised" License
550 stars 55 forks source link

Please indicate reliable CDN links in the docs/readme? #380

Open tomasts248 opened 1 year ago

tomasts248 commented 1 year ago

If I use:

    <script
  type="module"
  src="https://cdn.skypack.dev/playground-elements"
></script>

I'm getting: Uncaught Error: [Package Error] "@material/mwc-base" no dependency version info found. (Imported by "@material/mwc-button")

tomasts248 commented 1 year ago

Ok perhaps this one: https://www.jsdelivr.com/package/npm/playground-elements

tomasts248 commented 1 year ago

But I'm getting:

Uncaught TypeError: The specifier “tslib” was a bare specifier, but was not remapped to anything. Relative module specifiers must start with “./”, “…/” or “/”.

tinchox5 commented 1 year ago

@tomasts248
Pls, try https://www.jsdelivr.com/package/npm/playground-elements There are options to import playground, and it works for me!

tomasts248 commented 1 year ago

Thanks, but why I'm getting then the above error? and how should I prevent it from happening while using jsdelivr CDN? Edit: I'm trying to use the scripts by directly adding them to the head HTML in the front-end...

tinchox5 commented 1 year ago

Yes, that is what I did. Here my code:

<!DOCTYPE html>
<html lang="en">
<head>
<script type="module">
 import playgroundElements from 'https://cdn.jsdelivr.net/npm/playground-elements@0.18.1/+esm'
</script>
</head>
<body>
<playground-ide >
<!-- your playground code -->
</playground-ide>
</body>
</html>
tomasts248 commented 1 year ago

You are my hero!! it worked perfectly thank you so much IMHO this should be in the readme!!!

tomasts248 commented 1 year ago

The only reason I'm not closing this issue is to wait till is added to the readme..