Skip to content

[php-wasm/universal] Try require() before dynamic imprt in comlink-sync.ts #2363

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

Merged
merged 1 commit into from
Jul 14, 2025

Conversation

adamziel
Copy link
Collaborator

@adamziel adamziel commented Jul 14, 2025

Motivation for the change, related issues

#2317 introduced a dynamic import in a CJS code path (comlink-sync.ts). Node 20 requires a --experimental-vm-modules flag to run dynamic imports in such a context. This PR tries calling require() first to make it all work again.

Testing Instructions (or ideally a Blueprint)

Confirm the test-built-npm-packages test passed.

@adamziel adamziel added [Type] Bug An existing feature does not function as intended [Package][@wp-playground] CLI labels Jul 14, 2025
@adamziel adamziel marked this pull request as ready for review July 14, 2025 14:05
@adamziel adamziel changed the title Try require() before dynamic imprt in comlink-sync.ts [php-wasm/universal] Try require() before dynamic imprt in comlink-sync.ts Jul 14, 2025
@adamziel adamziel merged commit b943763 into trunk Jul 14, 2025
23 of 24 checks passed
@adamziel adamziel deleted the fix-test-built-npm-packages branch July 14, 2025 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package][@php-wasm] Universal [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant