Skip to content

ci: rename rollup configs to .mjs for Node 18 compatibility#5

Merged
jaschadub merged 1 commit intomainfrom
chore/ci-node18-compat
Apr 23, 2026
Merged

ci: rename rollup configs to .mjs for Node 18 compatibility#5
jaschadub merged 1 commit intomainfrom
chore/ci-node18-compat

Conversation

@jaschadub
Copy link
Copy Markdown
Contributor

Summary

Fixes the Node 18 matrix cell in `.github/workflows/ci.yml`, which errored out at the `Build all workspace packages` step with:

```
SyntaxError: Cannot use import statement outside a module
/home/runner/.../packages/types/rollup.config.js:1
import typescript from '@rollup/plugin-typescript';
```

Node 20+ transparently detects that the rollup config uses ESM and reparses it as a module. Node 18 does not — a `.js` file must either have `"type": "module"` in a nearby `package.json` or be renamed to `.mjs`.

Renaming to `.mjs` is the minimum-surface fix: no `package.json` changes, no source changes, just 9 file renames.

Test plan

  • `npm run build --workspaces` — all 9 packages build cleanly
  • `npx vitest run` — 1082/1082 tests pass

This PR just flips the extension; expected result in CI is Node 18 / 20 / 22 all green and the `build-artifact` job running through.

…lity

CI on Node 18 fails because each packages/*/rollup.config.js uses ESM
import syntax but no package.json declares "type": "module" and the
file extension is .js. Node 20+ transparently detects the ESM and
reparses as a module (the behavior we were relying on locally); Node 18
throws SyntaxError: Cannot use import statement outside a module.

Rename all 9 rollup configs from .js to .mjs, which is the canonical
way to mark a config file as ESM without forcing the whole package to
be type:module. No package.json or source changes needed.

Verified locally: `npm run build --workspaces` still builds all 9
packages, and `npx vitest run` still reports 1082/1082 tests passing.
@jaschadub jaschadub merged commit 36b4c61 into main Apr 23, 2026
2 of 4 checks passed
@jaschadub jaschadub deleted the chore/ci-node18-compat branch April 23, 2026 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant