javascript SyntaxError: import declarations may only appear at top level of a module Ошибка
Primary tabs
Ошибка появлялась для кода:
import {hello1} from "./mod1"; import {hello2} from "./mod2"; hello1(); hello2();
решение - при поключении указываем тип файла (type="module"):
<script src="/js/common.js" type="module"></script>
- Log in to post comments
- 4087 reads