Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Cannot find module 'conventional-changelog-*' #589

Closed
@1aron

Description

@1aron

Everything worked fine before v11.1; since@sheerlox introduces theimport-from-esm#537, and it's behavior became unreliable.

To reproduce

This error occurs in both cases.

Case 1

Clone my repo and run the test

git clone https://github.com/1aron/techor.gitcd techorpnpm ipnpm buildcd packages/semantic-release-configpnpmtest
> semantic-release-config-techor@test /Users/aron/techor/packages/semantic-release-config> jest FAIL  tests/rules.test.ts  ● Parse with"conventional-changelog-techor" by default    Cannot find module'conventional-changelog-techor'      11|'Feat(Scope2): Second feature'      12|     )> 13|     const releaseType = await analyzeCommits(|                         ^      14|         { preset:'techor', releaseRules },      15|         { cwd:process.cwd(), commits, logger: console }      16|     )      at importFrom (../../node_modules/.pnpm/import-from-esm@1.3.3/node_modules/import-from-esm/index.js:100:17)      at async _default (../../node_modules/.pnpm/@semantic-release+commit-analyzer@11.1.0_semantic-release@23.0.0/node_modules/@semantic-release/commit-analyzer/lib/load-parser-config.js:25:63)      at async analyzeCommits (../../node_modules/.pnpm/@semantic-release+commit-analyzer@11.1.0_semantic-release@23.0.0/node_modules/@semantic-release/commit-analyzer/index.js:31:18)      at async Object.<anonymous> (tests/rules.test.ts:13:25)

The reproductions above are all in the same monorepo, I think this is not entirely a bug caused by the monorepo, but caused byimport-from being changed toimport-from-esm.

conventional-changelog-techor is thepackages/conventional-changelog-config in the monorepo. This error is not caused by its own error, even if you useconventional-changelog-angular instead and specifypreset 'angular'.

The current version has not been changed to asynchronous function configuration, but this is not relevant.

Case 2

It's about my contribution#588. Perform the following steps on latest master branch:

npm i conventional-changelog-techor@2.5.24 -D

Add the newtest/presets.test.js

importtestfrom"ava";import{stub}from"sinon";import{analyzeCommits}from"../index.js";constcwd=process.cwd();test.beforeEach((t)=>{constlog=stub();t.context.log=log;t.context.logger={ log};});test('Accept "preset" option',async(t)=>{constcommits=[{hash:"123",message:"Fix: First fix (fixes #123)"},{hash:"456",message:"Update: Second feature (fixes #456)"},];constreleaseType=awaitanalyzeCommits({preset:"techor"},{ cwd, commits,logger:t.context.logger});t.is(releaseType,null);});
npmtest
> Cannot find module'conventional-changelog-techor'

If I remove the"exports": { ... }" section from "node_modules/conventional-changelog-techor/package.json", it will work.

So this is a problem withimport-from-esm itself, regardless of whether it is a monorepo or not.

When I changeimport-from-esm back toimport-from everything still works. This means that the changes in v11.1 did not include tests for the new functionality (#537), and these tests would have failed before v11.1. Changes add a lot of uncertainty.

Suggestion

Reverts:

Potentially relevant

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp