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

Failed to import implict cjs module with .ts extension in .mts file #45

Open
hyf0 opened this issue Nov 26, 2024 · 1 comment
Open

Failed to import implict cjs module with .ts extension in .mts file #45

hyf0 opened this issue Nov 26, 2024 · 1 comment
Assignees

Comments

@hyf0
Copy link

hyf0 commented Nov 26, 2024

In https://github.com/rolldown/rolldown/blob/0535a45140334005d359aa8f11bf9c1acd7c3e52/packages/rolldown/package.json#L65

Replace tsx with oxnode

image
@hyf0 hyf0 changed the title Failed to import implict cjs module in .mts file Failed to import implict cjs module with .ts extension in .mts file Nov 26, 2024
@hyf0
Copy link
Author

hyf0 commented Nov 26, 2024

image I think this is wrong. It's a cjs not a esm. It should use cjs loader.

@Brooooooklyn Brooooooklyn self-assigned this Nov 27, 2024
github-merge-queue bot pushed a commit to rolldown/rolldown that referenced this issue Feb 7, 2025
<!-- Thank you for contributing! -->

### Description

close #3407. The error
happened because the rolldown package added `type: module` at
#3376, it will make typing
check failed at `node16`, ref
https://www.typescriptlang.org/docs/handbook/modules/reference.html#module-format-detection.

The `type: module` added by using oxc-node build, if changed build file
to `build.mts` will caused error at
oxc-project/oxc-node#45. So i revert it to
`tsx` build. Here also add `build-types-check` to avoid regression.

<!-- Please insert your description here and provide especially info
about the "what" this PR is solving -->
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

2 participants