promisify crashing node
I have several different packages where semantic release is no longer working.
The last line in the log is this:
[3:27:11 PM] [semantic-release] › ℹ Start step "analyzeCommits" of plugin "@semantic-release/commit-analyzer"
The exit code is 0 so my pipelines proceed but no release is created.
This happens on several repositories, most open source, I'll link some CI traces here:
- https://github.com/collecthor/flysystem-adapters/actions/runs/6146191274/job/16675106648
- https://github.com/pheanstalk/pheanstalk/actions/runs/6123015944/job/16620078664
The code causing this issue lives in load-parser-config.js:
export default async ({ preset, config, parserOpts, presetConfig }, { cwd, logger }) => { let loadedConfig; const __dirname = dirname(fileURLToPath(import.meta.url)); if (preset) { const presetPackage = `conventional-changelog-${preset.toLowerCase()}`; loadedConfig = importFrom(cwd, presetPackage); } else if (config) { loadedConfig = importFrom.silent(__dirname, config) || importFrom(cwd, config); } else { loadedConfig = conventionalChangelogAngular; } // Comments added by @sammousa. // loadedConfig is an async function, specifically the createPreset export from conventional-changelog-conventionalcommits package // which implements the conventional commit standard that this package uses loadedConfig = await (typeof loadedConfig === "function" ? isPlainObject(presetConfig) ? loadedConfig(presetConfig) // this line crashes nodejs silently when called with an async function : promisify(loadedConfig)() : loadedConfig); return { ...loadedConfig.parserOpts, ...parserOpts }; };
The bug is definitely in nodeJS, the fix for this package however would be to not use promisify at all, since we're calling the function directly if there IS a configuration, why not also call it directly when there isn't?