You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Content mappers: a relative package path loads the package.json of the nearest folder with node_modulesΒ #65097
// project/tsconfig.json, beside mapper/, which has a package.json named "txt-mapper"
{
"contentMappers": [{ "package": "../mapper", "extensions": [".txt"] }]
}
π Actual behavior
project/tsconfig.json(3,35): error TS18077: The 'package.json' of the content mapper package '../mapper' does not specify a 'name'.
The package.json it read is the fixture root's, which has no name. "../does-not-exist" gives the same error. When that folder's package.json declares a content mapper, as in a package's own tests, that mapper runs without any error.
π Expected behavior
Either ../mapper resolves against the tsconfig's folder and loads mapper/, or it fails with TS18075 because only package names are supported.
Additional information about the issue
resolveContentMapperManifest passes the field to ResolvePackageDirectory. ParsePackageName returns .. as the package name, so the check that the package folder exists becomes DirectoryExists("<dir>/node_modules/.."), which passes in the first ancestor with a node_modules. The rest of the path is never read.
The same mapper referenced as "package": "txt-mapper" works; the repro checks both.
Activity