Cannot use import statement outside a module

Author: SyntaxSamurai43Created Apr 16, 2023Updated Jun 27, 2023

If I just add this code, it gives the error "Cannot use import statement outside a module" What am I doing wrong? See the code here: https://jsfiddle.net/4gvwatLn/

<script type="module" src="https://unpkg.com/rough-notation?module"></script>

<script>
import { annotate } from 'rough-notation';
// Or using unpkg
// import { annotate } from 'https://unpkg.com/rough-notation?module';

const e = document.querySelector('#myElement');
const annotation = annotate(e, { type: 'underline' });
annotation.show();
</script>

Source: rough-stuff/rough-notation