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

fix: remove type field #255

Closed
wants to merge 1 commit into from
Closed

fix: remove type field #255

wants to merge 1 commit into from

Conversation

tmkx
Copy link
Contributor

@tmkx tmkx commented Jul 19, 2023

πŸ”— Linked issue

close #251

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

exports has declared which file to require or import, it's a dual-format package.

{
  "exports": {
    "default": {
      "types": "./dist/index.d.ts",
      "import": "./dist/index.mjs",
      "require": "./dist/index.cjs"
    }
  }
}

But if type is module, it can't be imported in a commonjs file.

The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("ofetch")' call instead.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@pi0
Copy link
Member

pi0 commented Jul 19, 2023

Thanks for the PR. I don't think removing type: module is the right fix. let's keep tracking via #251.

@pi0 pi0 closed this Jul 19, 2023
@tmkx tmkx deleted the fix/ts-1479 branch July 19, 2023 09:08
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

Successfully merging this pull request may close these issues.

The type declarations are not compatible with NodeNext
2 participants