-
Notifications
You must be signed in to change notification settings - Fork 215
Description
Describe the bug
Seems to be unable to load ESM for a local plugin.
To Reproduce
- Create a file at
.auto/plugins/test.ts - add
console.log('Works')intests.tsfile - In
.autorc, do the following
{
"plugins": [
... // other plugins
"./.auto/plugins/test.ts"
],
// other config
}
- Run
yarn auto shipit -d
output:
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /Users/tlkiong/Desktop/work/test/.auto/plugins/test.ts
require() of ES modules is not supported.
require() of /Users/tlkiong/Desktop/work/test/.auto/plugins/commit-sha.ts from /Users/tlkiong/Desktop/work/test/node_modules/import-from/index.js is an ES module file as it is a .ts file whose nearest parent package.json contains "type": "module" which defines all .ts files in that package scope as ES modules.
Instead change the requiring code to use import(), or remove "type": "module" from /Users/tlkiong/Desktop/work/test/package.json.
And yes, I have "type": "module", in my package.json
Expected behavior
Screenshots
Environment information:
Environment Information:
"auto" version: v11.2.0
"git" version: v2.40.0
"node" version: v22.2.0
Project Information:
✔ Repository: ~
✔ Author Name: tlkiong
✔ Author Email: ~
✔ Current Version: v1.109.0
✔ Latest Release: v1.109.0
✖ Labels configured on GitHub project (Try running "auto create-labels")
GitHub Token Information:
✔ Token: [Token starting with ghp_]
✔ Repo Permission: admin
✔ User: tlkiong
✔ API:
✔ Enabled Scopes: repo, workflow, write:packages
✔ Rate Limit: 4997/5000Additional context