Skip to content

Diagnostics should not include absolute paths #25747

Closed
@evmar

Description

@evmar

TypeScript Version: 3.1.0-dev.20180717, older verisons too

Search Terms: absolute path diagnostics

Code

// foo.ts export {}; // bar.ts import {nosuch} from './foo';

Expected behavior:
Error message about nosuch that mentions paths relative to the project.

Actual behavior:
Error message includes absolute path:

$ tsc bar.ts:1:9 - error TS2305: Module '"/usr/local/google/home/evanm/t/foo"' has no exported member 'nosuch'. 1 import {nosuch} from './foo'; ~~~~~~ 

This matters because:

  • it's confusing and inconsistent with other error messages
  • we don't want to include private paths in error messages
  • if the editor services is running in the cloud or whatever then it references bogus paths

Metadata

Metadata

Assignees

Labels

Domain: Error MessagesThe issue relates to error messagingExperience EnhancementNoncontroversial enhancementsFixedA PR has been merged for this issueSuggestionAn idea for TypeScript

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions