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

.cjs extension is supported, but not .cts in version 2 (rc) #25498

Open
wellwelwel opened this issue Sep 7, 2024 · 0 comments
Open

.cjs extension is supported, but not .cts in version 2 (rc) #25498

wellwelwel opened this issue Sep 7, 2024 · 0 comments
Assignees
Milestone

Comments

@wellwelwel
Copy link

wellwelwel commented Sep 7, 2024

Version: Deno 2.0.0-rc.1

I noticed that, in version 2, I can run .cjs files, but not .cts files. Using any version from 1.x.x onwards, including the latest (1.46.3), both runs work fine.

I'd like to understand it better:

Is it intentional to accept .cjs but not .cts (not an issue), should both not be supported or should both work as in previous major version?

The message error:

Expected a JavaScript or TypeScript module, but identified a Cts module. Importing these types of modules is currently not supported.
  • Perhaps "unrecognized" fits better than "not supported" for this report.
  • This error doesn't occur during import, but with the deno run command.

For a brief context, these tests are totally empty files, just to make sure that a test runner is properly targeting each file by extension according to how each runtime (Node.js, Bun and Deno) handles them.

Before v2 (1.46.3):

Screenshot 2024-09-06 at 21 10 12

After v2 (2.0.0-rc.1):

Screenshot 2024-09-06 at 21 17 14
Screenshot 2024-09-06 at 21 19 00

Being my first issue here, thanks for Deno 🦕💙

@wellwelwel wellwelwel changed the title .cjs imports are supported, but not .cts in version 2 (rc) .cjs extension is supported, but not .cts in version 2 (rc) Sep 7, 2024
@bartlomieju bartlomieju added this to the 2.0.0-rc.2 milestone Sep 8, 2024
@bartlomieju bartlomieju modified the milestones: 2.0.0-rc.2, 2.0.0-rc.3, 2.0.0 Sep 12, 2024
@bartlomieju bartlomieju modified the milestones: 2.0.0, 2.1.0 Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants