Skip to content

Intermittent resolution failure with yarn pnp #28

@mrginglymus

Description

@mrginglymus

Following from un-ts/eslint-plugin-import-x#242

I have several agents, some of which appear to have become corrupted and fail to resolve files - on some agents it always works, on others it always fails. On my machine, alas, it always works.

broken agent:

2025-03-19T11:20:07.9851666Z 2025-03-19T11:20:07.983Z eslint-plugin-import-x:utils:ModuleCache cache miss for /home/ubuntu/actions-runner/_work/project/project/.storybook#import-x/resolver-next:@#resolve:4~,name:"eslint-plugin-import-x built-in node resolver",interfaceVersion:3,,,import-x/parsers:#@typescript-eslint/parser:@".ts",".tsx",,,import-x/internal-regex:"^@project/",import-x/external-module-folders:@".yarn",,@storybook/preview-api
2025-03-19T11:20:07.9984656Z 2025-03-19T11:20:07.997804Z DEBUG resolve{path="/home/ubuntu/actions-runner/_work/project/project/.storybook" specifier="@storybook/preview-api"}:resolve{path="/home/ubuntu/actions-runner/_work/project/project/.yarn/__virtual__/@storybook-preview-api-virtual-47b5a7e6da/7/root/.yarn/berry/cache/@storybook-preview-api-npm-8.6.7-d7bf2d04d6-10c0.zip/node_modules/@storybook/preview-api/" specifier="./"}: unrspack_resolver: options=ResolveOptions { tsconfig: None, alias: [], alias_fields: [], condition_names: ["vndev", "import"], description_files: ["package.json"], enable_pnp: true, enforce_extension: Disabled, exports_fields: [["exports"]], imports_fields: [["imports"]], extension_alias: [(".js", [".ts", ".js"])], extensions: [".ts", ".tsx", ".js"], fallback: [], fully_specified: false, main_fields: ["module", "main"], main_files: ["index"], modules: ["node_modules"], resolve_to_context: false, prefer_relative: false, prefer_absolute: false, restrictions: [], roots: [], symlinks: true, builtin_modules: false } path="/home/ubuntu/actions-runner/_work/project/project/.yarn/__virtual__/@storybook-preview-api-virtual-47b5a7e6da/7/root/.yarn/berry/cache/@storybook-preview-api-npm-8.6.7-d7bf2d04d6-10c0.zip/node_modules/@storybook/preview-api/" specifier="./" err=NotFound("./")

working agent

2025-03-19T11:17:42.6751646Z 2025-03-19T11:17:42.674Z eslint-plugin-import-x:utils:ModuleCache cache miss for /home/ubuntu/actions-runner/_work/project/project/.storybook#import-x/resolver-next:@#resolve:4~,name:"eslint-plugin-import-x built-in node resolver",interfaceVersion:3,,,import-x/parsers:#@typescript-eslint/parser:@".ts",".tsx",,,import-x/internal-regex:"^@project/",import-x/external-module-folders:@".yarn",,@storybook/preview-api
2025-03-19T11:17:42.6756747Z 2025-03-19T11:17:42.674716Z DEBUG resolve{path="/home/ubuntu/actions-runner/_work/project/project/.storybook" specifier="@storybook/preview-api"}: unrspack_resolver: options=ResolveOptions { tsconfig: None, alias: [], alias_fields: [], condition_names: ["vndev", "import"], description_files: ["package.json"], enable_pnp: true, enforce_extension: Disabled, exports_fields: [["exports"]], imports_fields: [["imports"]], extension_alias: [(".js", [".ts", ".js"])], extensions: [".ts", ".tsx", ".js"], fallback: [], fully_specified: false, main_fields: ["module", "main"], main_files: ["index"], modules: ["node_modules"], resolve_to_context: false, prefer_relative: false, prefer_absolute: false, restrictions: [], roots: [], symlinks: true, builtin_modules: false } path="/home/ubuntu/actions-runner/_work/project/project/.storybook" specifier="@storybook/preview-api" ret="/home/ubuntu/actions-runner/_work/project/project/.yarn/__virtual__/@storybook-preview-api-virtual-47b5a7e6da/5/.yarn/berry/cache/@storybook-preview-api-npm-8.6.7-d7bf2d04d6-10c0.zip/node_modules/@storybook/preview-api/shim.mjs"

I'm struggling to follow the code path, but the significant difference appears to be an additional

resolve{path="/home/ubuntu/actions-runner/_work/project/project/.yarn/__virtual__/@storybook-preview-api-virtual-47b5a7e6da/7/root/.yarn/berry/cache/@storybook-preview-api-npm-8.6.7-d7bf2d04d6-10c0.zip/node_modules/@storybook/preview-api/" specifier="./"}

appearing in the broken agent. Note the /7/ in the path; on the working agent it's a /5/ (though on my local machine it's a /3/.

All are running the same version of node and yarn. These paths are all defined in .pnp.cjs which is created from scratch on each agent.


edit: urgh, on the broken agents the /7/ path does match what's in the .pnp.cjs.

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