Closed elite174 closed 5 months ago
try the following code to reproduce
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<script type="module">
import json from "https://unpkg.com/esptool-js@0.3.2/lib/targets/esp32.js?module";
</script>
</body>
</html>
I guess the reason for this this line:
import ESP32_STUB from "./stub_flasher/stub_flasher_32.json?module";
The point is that you don't need to use ?module
for json files
@brianignacio5 Could you fix this please?
How about using the resulting bundle file : https://unpkg.com/esptool-js@0.3.2/bundle.js ?
Yes, that would work. But anyways, it's better be fixed
Also you need to update README then, because it recommends using https://unpkg.com/esptool-js/lib/index.js?module
I think is also the fact that ?module is also experimental and probably not be used.
For example using https://unpkg.com/esptool-js@0.3.2/lib/targets/stub_flasher/stub_flasher_32.json seems to work. Maybe we remove ?module from readme and add bundle.js too.
I'm trying to use this lib in the browser without compilation and get this error.