im trying to use CDN install here Drag & Drop | Uppy
my code like this :
https://codeshare.io/DZ8wKE
its shows error :
Uncaught SyntaxError: The requested module does not provide an export named ‘DragDrop’ (at index.htm:13:22)
im trying to use CDN install here Drag & Drop | Uppy
my code like this :
https://codeshare.io/DZ8wKE
its shows error :
Uncaught SyntaxError: The requested module does not provide an export named ‘DragDrop’ (at index.htm:13:22)
i have same problem using npm it works but i have to use cdn
I also have the same problem…
You should be using the .mjs
file extension, not .js
. Here’s the correct snippet:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://releases.transloadit.com/uppy/v3.12.0/uppy.min.css" rel="stylesheet">
<title>Uppy Example</title>
</head>
<body>
<div id="uppy"></div>
<script type="module">
import { Uppy, DragDrop } from "https://releases.transloadit.com/uppy/v3.12.0/uppy.min.mjs"
const uppy = new Uppy()
uppy.use(DragDrop, { target: '#uppy' })
</script>
</body>
</html>