🔎 Search Terms
yarn pnp or pnpm symlink, A type annotation is necessary.

🕗 Version & Regression Information
typescript@5, using yarn berry pnp mode, cannot reference the actions of @reduxjs/toolkit, but there is no problem using typescript@4.9.5.
⏯ Playground Link
No response
💻 Code
import{createEntityAdapter,createSlice}from'@reduxjs/toolkit';exportinterfaceIFileNav{id: stringpath: string;}constfileNavAdapter=createEntityAdapter<IFileNav>();constfileNavSlice=createSlice({name: 'file_nav',initialState: fileNavAdapter.getInitialState(),reducers: {add: fileNavAdapter.addMany,remove: fileNavAdapter.removeMany,},});exportconstactions=fileNavSlice.actions;🙁 Actual behavior
The following error message appears, but the type reference can still be indexed
The inferred type of 'actions' cannot be named without a reference to '../../.yarn/__virtual__/@reduxjs-toolkit-virtual-5ff160901c/4/.yarn/berry/cache/@reduxjs-toolkit-npm-2.2.3-3fa8bcc11c-10c0.zip/node_modules/@reduxjs/toolkit/dist/entities/models'. This is likely not portable. A type annotation is necessary.
🙂 Expected behavior
The type declaration of symlink can be obtained correctly
Additional information about the issue
// .yarnrc.yml
changesetBaseRefs:
- master
- origin/masterchecksumBehavior: updateconditions:
USE_SRC:
default: falseenableColors: trueenableGlobalCache: trueenableStrictSsl: falsenodeLinker: pnpnpmPublishRegistry: 'https://bnpm.byted.org/'npmRegistryServer: 'https://bnpm.byted.org/'plugins:
- path: .yarn/plugins/@yarnpkg/plugin-conditions.cjsspec: 'https://raw.githubusercontent.com/nicolo-ribaudo/yarn-plugin-conditions/main/bundles/%40yarnpkg/plugin-conditions.js'pnpEnableEsmLoader: trueunsafeHttpWhitelist:
- bnpm.byted.orgyarnPath: .yarn/releases/yarn-4.2.1.cjs
// tsconfig.json
{
"compilerOptions": {
// Type Checking"strict": true,
"strictPropertyInitialization": false,
"exactOptionalPropertyTypes": true,
"noFallthroughCasesInSwitch": true,
"noImplicitOverride": true,
"noImplicitReturns": true,
"noPropertyAccessFromIndexSignature": true,
// Modules"allowArbitraryExtensions": true,
"baseUrl": ".",
"module": "ES2022",
"moduleResolution": "Bundler",
"resolveJsonModule": true,
// Emit"declaration": true,
"declarationMap": true,
"noEmitOnError": true,
"outDir": "build",
"removeComments": true,
"sourceMap": true,
"stripInternal": true,
// JavaScript Support"allowJs": true,
// Interop Constraints"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
// Language and Environment"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"jsx": "preserve",
"target": "ES2022",
// Projects"composite": true,
"incremental": true,
// Output Formatting"skipLibCheck": true
},
"include": ["client", "server", "protocol"],
"exclude": ["node_modules", "build"],
"ts-node": {
"transpileOnly": true,
"esm": true,
"swc": true,
"require": ["tsconfig-paths/register"],
"compilerOptions": {
"module": "NodeNext",
"moduleResolution": "NodeNext"
}
}
}
🔎 Search Terms
yarn pnp or pnpm symlink, A type annotation is necessary.
🕗 Version & Regression Information
typescript@5, using yarn berry pnp mode, cannot reference the actions of @reduxjs/toolkit, but there is no problem using typescript@4.9.5.
⏯ Playground Link
No response
💻 Code
🙁 Actual behavior
The following error message appears, but the type reference can still be indexed
🙂 Expected behavior
The type declaration of symlink can be obtained correctly
Additional information about the issue
// .yarnrc.yml
// tsconfig.json
{ "compilerOptions": { // Type Checking"strict": true, "strictPropertyInitialization": false, "exactOptionalPropertyTypes": true, "noFallthroughCasesInSwitch": true, "noImplicitOverride": true, "noImplicitReturns": true, "noPropertyAccessFromIndexSignature": true, // Modules"allowArbitraryExtensions": true, "baseUrl": ".", "module": "ES2022", "moduleResolution": "Bundler", "resolveJsonModule": true, // Emit"declaration": true, "declarationMap": true, "noEmitOnError": true, "outDir": "build", "removeComments": true, "sourceMap": true, "stripInternal": true, // JavaScript Support"allowJs": true, // Interop Constraints"allowSyntheticDefaultImports": true, "esModuleInterop": true, // Language and Environment"emitDecoratorMetadata": true, "experimentalDecorators": true, "jsx": "preserve", "target": "ES2022", // Projects"composite": true, "incremental": true, // Output Formatting"skipLibCheck": true }, "include": ["client", "server", "protocol"], "exclude": ["node_modules", "build"], "ts-node": { "transpileOnly": true, "esm": true, "swc": true, "require": ["tsconfig-paths/register"], "compilerOptions": { "module": "NodeNext", "moduleResolution": "NodeNext" } } }