-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Open
Labels
Needs InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.RescheduledThis issue was previously scheduled to an earlier milestoneThis issue was previously scheduled to an earlier milestone
Milestone
Description
Bug Report
π Search Terms
Nodenext wildcard, type cannot be named
π Version & Regression Information
The bug only appears when using nodenext for module resolution
β― Playground Link
Cloneable repo: https://github.com/geoffreytools/effect-test-tsc
π» Code
import { TaggedClass } from '@effect/data/Data';
// import '@effect/data/Equal';
export class Foo extends TaggedClass('Foo')<{}> {}
π Actual behavior
The inferred type of 'Foo' cannot be named without a reference to '../node_modules/@effect/data/Equal'. This is likely not portable. A type annotation is necessary.
π Expected behavior
To compile correctly, without using nodenext it works fine and the same issue doesn't apply to other transitive imports such as Hash that are identically exported. All goes away the very moment there is either an explicit import of Equal
or when adding to the library package.json the following:
{
"exports": {
"./Equal": {
"import": {
"types": "./Equal.d.ts",
"default": "./mjs/Equal.mjs"
}
}
}
}
Note that the library uses a wildcard ./*
as each import map to a file and this is perfectly resolvable by node
datner, geoffreytools, JohnieXu, fubhy, vecerek and 18 morefregante, grahamlangford and brittanyjoiner15
Metadata
Metadata
Assignees
Labels
Needs InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.RescheduledThis issue was previously scheduled to an earlier milestoneThis issue was previously scheduled to an earlier milestone