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
I can reproduce this issue when running this plugin on its own. Other plugins, such as node-resolve are known to cause issues.
I am running this plugin on .d.ts files generated by TypeScript. The plugin can consume .ts and even .js files (with allowJs: true), but this is known to cause issues.
This issue is not related to rolling up @types. The plugin ignores these by default, unless respectExternal is set. @types can contain hand-crafted code which is known to cause issues.
Thanks for the report!
This is unfortunately a restriction that TS does variable hoisting for namespaces. Working around this is annoying and fragile :-(
I mass-closed all the issues, as I transition the project into maintenance mode and won’t be working on any of it, see #277
However I wasn’t able to mass-close-and-comment mentioning that.
Checklist
Other plugins, such as
node-resolve
are known to cause issues..d.ts
files generated by TypeScript.The plugin can consume
.ts
and even.js
files (withallowJs: true
), but this is known to cause issues.@types
.The plugin ignores these by default, unless
respectExternal
is set.@types
can contain hand-crafted code which is known to cause issues.Code Snipped
I've pushed a reproduction of this https://github.com/kraenhansen/rollup-plugin-dts-issue-223
Results in the following output:
Error Message
The
type Thing = Thing;
in the output file above yields:Which effectively results in the type being
any
for a consumer (seeconsumer.ts
in the reproduction).Workaround
Note that if I add a local type alias in the
index.ts
, the output turns out as expected:yields
The text was updated successfully, but these errors were encountered: