The JavaScript exception "import declarations may only appear at top level of a module" occurs when an import declaration is not at the top level of a module. This might be because the import declaration is nested in other constructs (functions, blocks, etc.), or more often because the current file is not treated as a module....is directly loaded from HTML, make sure the <script> tag has the...If the file is run in Node, make sure either the file has the...