- Can I just await an import at the top of a CommonJS file?
- No — top-level await only exists in ES modules. Put the dynamic import inside an async function, or restructure so the module exports an async initialiser that the caller awaits.
- Why did this start after npm install with no code change?
- A caret range let the package move to a new major that dropped CommonJS.
npm ls <package> shows the installed version and npm view <package> versions shows what changed. Lockfiles exist to stop this, so check whether the lockfile was regenerated or ignored. - Is converting my project to ESM worth it?
- For a new project, yes — the ecosystem is moving that way and tooling now assumes it. For an existing CommonJS codebase with many entry points, the migration touches every file and every test config, so a dynamic import at the one call site is usually the proportionate fix.