Skip to content

EvanBacon/inline-requires-issue

Repository files navigation

Inline requires bug

A bug with inline requires and experimental import support where wrapping export const ghQueueMicrotask = queueMicrotask; throws a TypeError: Illegal invocation when invoked from an external module—only on web.

If inline requires, or experimental import support are removed, the error does not occur.

Repro

  1. Clone this repo
  2. Run npx expo install
  3. Run npx expo start --web

Possible causes

I'd imagine that the issue is related to the scope binding. In tsc for example, the inline would have the null binding treatment, e.g. (0, ghQueueMicrotask)(). If you manually add this to the example, then it works as expected. Perhaps this needs to be added to the Metro inline requires plugin.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published