Skip to content

Conversation

@nathanfallet
Copy link
Member

Fixes #35

"npx", "tsc", "--init",
"-d",
"--module", "ES2020",
"--moduleResolution", "node",
Copy link
Contributor

@rocketraman rocketraman Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typescript docs indicate this should not be used for new projects (https://www.typescriptlang.org/docs/handbook/modules/reference.html#node10-formerly-known-as-node).

I would imagine bundler might be more appropriate for code that is going to target RN or the web?

Also note this from the docs:

--moduleResolution bundler must be paired with --module esnext or --module preserve.

Test results:
  React Web (Vite/Webpack):
  - Uses bundlers that handle ESM perfectly
  - controlresell web app already uses bundler resolution
  - Will work seamlessly

  React Native (Metro):
  - Metro bundler supports ES modules
  - controlresell-app uses bundler resolution
  - Will work seamlessly

  Node.js:
  - With "type": "module" in package.json, Node.js handles ESM natively
  - Confirmed working in our test
@nathanfallet nathanfallet merged commit 8d4dcf5 into main Nov 26, 2025
1 check failed
@nathanfallet nathanfallet deleted the fix/npm-package-compatibility branch November 26, 2025 14:26
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.

npm module type mismatch

3 participants