Uncaught SyntaxError: No se puede usar la instrucción import fuera de un módulo
1. Inside scripts file import the following module
import {a} from "./module.js";
alert(a);
2. add that script inside file you want to use it
<script type="module" src="PATH_TO_FILE"></script>
no se puede usar la instrucción import fuera de un módulo typescript
// Fix 1
Change .js files to .cjs
// Fix 2
Add "type": "module" to package.json
Uncaught SyntaxError: No se puede usar la instrucción import fuera de un módulo tres.js
//If you already put this and still error.
<script src="/node_modules/three/examples/jsm/controls/OrbitControls.js"></script>
//Try changing jsm to js
<script src="/node_modules/three/examples/js/controls/OrbitControls.js"></script>