Skip to content

Conversation

@DenysKuchma
Copy link
Collaborator

Problem

When using ts-node/esm with "module": "esnext" in tsconfig.json, users get "Cannot find module" errors because imports without file extensions don't work.
This is a known limitation of ts-node/esm, not a bug in CodeceptJS, but users don't understand what's happening. #5323

Solution

Add a warning message when ts-node/esm is detected in the config. The warning:

  • Explains the limitation clearly
  • Recommends tsx/cjs as an alternative
  • Links to documentation

@DenysKuchma DenysKuchma requested a review from DavertMik January 12, 2026 21:13
return `
⚠️ Warning: ts-node/esm with "module": "esnext" requires explicit file extensions in all imports.
This is a known limitation. Use tsx/cjs instead to write imports without extensions.
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add an example here

Which import is OK which is not OK

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.

3 participants