Closed xaviergonz closed 1 year ago
Please don't remove the issue template, it's there for a reason, and your issue is missing many of the details we request from it as well since you removed it...
For instance, you have no repro, no Rollup config, and no package.json
with versions, among other problems...
As a fellow OSS maintainer, I'd imagine you're well aware of how problematic issues without a template often are.
From the little information available, a few things pop up:
[rpt2] error TS5070: Option '--resolveJsonModule' cannot be specified when 'moduleResolution' is set to 'classic'.
This error message suggests that you set moduleResolution: 'classic'
, but that seems incorrect based on your tsconfig
. rpt2 also forces moduleResolution: 'node'
, since 'classic'
is legacy and incompatible.
So that's an odd error message. We don't hard-code this option, we use the enum / identifier from TS itself: ts.ModuleResolutionKind.NodeJs
. So that's potentially a TS bug if it's picking up 'classic'
instead? 🤔
Also note that rpt2's TS errors are coming from TS itself; rpt2 just forwards the errors, which have the TS error identifier in them. The issue template asks if the same error occurs with tsc
, as many errors that are reported here are just TS errors and independent of rpt2.
build: 23 export * from "./wrappers"
This part sounds familiar to #434. I don't know what that code is referencing given how little information is in the issue, but per #434, TS 5.0 beta appears to follow the ESM spec more stringently, and so directory imports no longer work. I'm not sure if that's a directory import -- there is no repro or source code to be found in this issue -- but if it is, please see #434, which is not a bug in rpt2, but rather non-spec code.
That's all I can say given the information available, this is why the issue template asks for much more information.
Thanks for looking into it even though I didn't fill in the template!
So that's an odd error message. We don't hard-code this option, we use the enum / identifier from TS itself: ts.ModuleResolutionKind.NodeJs. So that's potentially a TS bug if it's picking up 'classic' instead? 🤔
Actually that might be the issue, apparently TS renamed ModuleResolutionKind.NodeJs
to ModuleResolutionKind.Node10
for v5.0, so I guess NodeJs is returning undefined, which defaults to classic somehow
Btw, tsc -c
compiles fine
0.34.1 seems to work fine with typescript 5.0.4, looks like it was fixed upstream? @xaviergonz do you still see similar errors on current typescript versions?
it worked with the final version. thanks
Actually that might be the issue, apparently TS renamed
ModuleResolutionKind.NodeJs
toModuleResolutionKind.Node10
for v5.0, so I guess NodeJs is returning undefined, which defaults to classic somehow
Yea looks like this was indeed an upstream TS bug: https://github.com/microsoft/TypeScript/issues/53131. Was fixed in TS 5.0.2. I was gonna suggest that you might want to file upstream and could probably PR a fix for that upstream too since you already found the code references, particularly as it was still beta back in Feb.
Didn't quite get around to writing that timely here, sorry! Think I was recovering from COVID in Feb while simultaneously dealing with (another) re-org at work and heading up a new team from scratch as a result.
After updating to TS5.0-beta my compilation gives the following error (which does not happen with 4.9 or when this plugin is disabled):
My tsconfig is the following:
if I remove resolveJsonModule then I get a lot of errors like
errors that do not disappear even if I actually change moduleResolution from node to nodenext