Skip to content

Conversation

@Danil42Russia
Copy link
Contributor

@Danil42Russia Danil42Russia commented Nov 20, 2025

Issue

When compiling ESM using esbuild and running it on the web, we get the error: Dynamic require of "@ton/test-utils" is not supported.
esbuild cannot generate code that finds dependencies at runtime, but only when the name is specified as a string literal (provided that the package is actually present in the project; if not, we will also get this error).

Yes, this won't save you from an error when the package really isn't there, but it will remove the error when the package is actually there, but esbuild (or other builders) can't find it because the name isn't a string literal.

See:

  1. https://esbuild.github.io/api/#format-esm
  2. https://esbuild.github.io/api/#non-analyzable-imports

Checklist

Please ensure the following items are completed before requesting review:

  • Updated CHANGELOG.md with relevant changes
  • Documented the contribution in README.md
  • Added tests to demonstrate correct behavior (both positive and negative cases)
  • All tests pass successfully
  • Code passes linting checks (yarn lint)

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.

1 participant