javascript SyntaxError: import declarations may only appear at top level of a module Ошибка

Ошибка появлялась для кода:

import {hello1} from "./mod1";
import {hello2} from "./mod2";

hello1();
hello2();

решение - при поключении указываем тип файла (type="module"):

<script src="/js/common.js" type="module"></script>