Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on new typescript file pattern .d.mts .d.cts #1032

Closed
loynoir opened this issue Nov 3, 2021 · 5 comments
Closed

Crash on new typescript file pattern .d.mts .d.cts #1032

loynoir opened this issue Nov 3, 2021 · 5 comments

Comments

@loynoir
Copy link

loynoir commented Nov 3, 2021

Expected Behavior

No error

Actual Behavior

$ rollup -c
./index.mjs → stdout...                                                                                          
[!] Error: Unexpected token (Note that you need plugins to import files that are not JavaScript)                 
lib/a.d.mts (1:7)
1: export declare const value = "a";
          ^
Error: Unexpected token (Note that you need plugins to import files that are not JavaScript)

Additional Information

Typescript have new file pattern .d.mts .d.cts

@shellscape
Copy link
Collaborator

Do you have a link for a spec defining these file extensions?

@loynoir
Copy link
Author

loynoir commented Nov 3, 2021

I think main pull is
microsoft/TypeScript#45884

And entry file index.mjs reference to lib/a.mjs lib/a.d.mts, are generated by official tsc command.

@shellscape
Copy link
Collaborator

Thanks, but that PR has 569 files that we're definitely not going to sift through. To consider this a bug, we'll need a link to spec or docs showing that TS officially supports these lnew extensions.

@Septh
Copy link

Septh commented Dec 17, 2021

The new extensions were announced with the 4.5 beta : https://devblogs.microsoft.com/typescript/announcing-typescript-4-5-beta/#new-file-extensions

Not sure what the status is right now since many module-related things have been officially delayed and are only available as an experimental flag in nightly releases. : https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-5.html#whats-new-since-the-beta-and-rc

@stale stale bot added the x⁷ ⋅ stale label Feb 16, 2022
@stale
Copy link

stale bot commented Feb 18, 2022

Hey folks. This issue hasn't received any traction for 60 days, so we're going to close this for housekeeping. If this is still an ongoing issue, please do consider contributing a Pull Request to resolve it. Further discussion is always welcome even with the issue closed. If anything actionable is posted in the comments, we'll consider reopening it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants