SyntaxError: Cannot use import statement outside a module

The file contains a static import, but the loader is treating it as a classic script or as CommonJS. In a browser, inspect the entry tag that loads the file. Also confirm that the server is returning the intended build for that URL.
Serve a native browser module over HTTP or HTTPS and load its entry with type="module". Check the response media type and how each import URL resolves. If the error comes from Node, check the file extension and package module configuration used by that process.
Switching the tag can reveal a second problem such as a missing file or an HTML response from a fallback route. Verify the first imported response after correcting module mode.
// Use a module entry on the page: script type="module" src="/app.js" import { init } from './init.js'; init();
Inspect the actual entry script tag, then open its JavaScript response and verify the first imported URL.