Skip to content

@link to exported member with declaration reference links to top of module #2810

Closed
@aayla-secura

Description

@aayla-secura

Search terms

link, declaration references

Expected Behavior

I expect the link to point to the relevant object, class, etc regardless which resolution type is used.

Actual Behavior

When I link to an exported in another module using the declaration reference syntax (because the linked member is not imported by the file for example), the link points to the top/root module and not to the exported member.

Steps to reproduce the bug

For example, moduleA exports someVar, which in the doc has its own page.

If I import this into moduleB and use {@link someVar} it correctly links to it.

If I don't import it and use {@link moduleA!~someVar} it links to moduleA.

Relevant installed packages + versions

typedoc-plugin-merge-modules@6.1.0
typedoc@0.26.11
typescript@5.6.3

tsconfig.json

{
	"compilerOptions": {
		"target": "esnext",
		"module": "preserve",
		"moduleResolution": "node",
		"outDir": "./dist/types/",
		"declaration": true,
		"declarationMap": true,
		"emitDeclarationOnly": true,
		"isolatedModules": true,
		"forceConsistentCasingInFileNames": true,
		"strict": true,
		"noImplicitAny": true,
		"strictNullChecks": true,
		"strictFunctionTypes": true,
		"strictBindCallApply": true,
		"strictPropertyInitialization": true,
		"noImplicitThis": true,
		"useUnknownInCatchVariables": true,
		"alwaysStrict": true,
		"noImplicitReturns": true,
		"noFallthroughCasesInSwitch": true,
		"skipDefaultLibCheck": false,
		"skipLibCheck": false
	},
	"include": ["src/ts/"],
	"typedocOptions": {
		"entryPoints": [
			"src/ts/"
		],
		"entryPointStrategy": "expand",
		"out": "docs/",
		"plugin": ["typedoc-plugin-merge-modules"],
		"mergeModulesMergeMode": "module" // added by plugin typedoc-plugin-merge-modules
	}
}

How you are running TypeDoc + any relevant configuration files

npx typedoc

Environment

  • Typedoc version: 0.26.11
  • TypeScript version: 5.6.3
  • Node.js version: 20.18.0
  • OS: Ubuntu on WSL2 on Windows 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions