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
× An export assignment cannot be used in a module with other exported elements.
╭─[./packages/nameof/src/index.cts:9:1]
6 │ export import version = meta.version;
7 │ }
8 │
9 │ export = nameof;
· ────────────────
╰────
Version
1.7.35
Additional context
A workaround which seems to work currently is using export const =, export var = or export let = instead of export import =.
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Describe the bug
Exporting namespace aliases (using the
export import = ...
-syntax) breaks the use of theexport =
syntax.Input code
meta.ts
nameof.ts
Config
Playground link (or link to the minimal reproduction)
https://play.swc.rs/?version=1.7.35&code=H4sIAAAAAAAAA8tLzE0tLkhMTlXITS1JVKjmUgCC1IqC%2FKISheT8vOIShbLUouLM%2FDwFWwUlQz0DPQMla65aLq48uD4QKz8NVWdmLphCaAUZrgflgvVDFUJkrLkA%2BHamM4cAAAA%3D&config=H4sIAAAAAAAAA1WPSw7DMAhE9z6FxbrbbnqHHsJySeTIPwGRakW5e%2B3UTpsdzAw82JTWsLCFh95qWZtsiJHOvipcoph3VUBKRrbkssBtuMLNmoxnPKT964AYmlHaFPK9x8GnxDjiXQsuuqn8A20KmZD5GmxRE2ePV5zqSAjptR5mf6Qd2%2FB1W0hxYfglB%2FHcDo6fY1xoRbV%2FALu7P%2BkZAQAA
SWC Info output
Expected behavior
Output should equal to the one in TypeScript Playground:
https://www.typescriptlang.org/play/?module=1#code/HYQwtgpgzgDiDGEAEkAuIkG8BQS9IgA8YB7AJ1SXhOCkoDcIyoBLGpAXiQCIBGAOgAMQ7gG5sAX2zZQkWAmSyIJAGZZc+IqQpIWYbQyat2XNCH6NmbYOKnYt5SlyWrxQA
Actual behavior
Following error is displayed:
Version
1.7.35
Additional context
A workaround which seems to work currently is using
export const =
,export var =
orexport let =
instead ofexport import =
.Namespace aliases are documented here:
https://www.typescriptlang.org/docs/handbook/namespaces.html#aliases
The text was updated successfully, but these errors were encountered: