Skip to content
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

__dirname is not defined in ES module scope #1559

Closed
1 task done
wojtekmaj opened this issue Jan 18, 2024 · 3 comments
Closed
1 task done

__dirname is not defined in ES module scope #1559

wojtekmaj opened this issue Jan 18, 2024 · 3 comments

Comments

@wojtekmaj
Copy link

Report

Issues and Steps to Reproduce

Import yoga-layout in an ESM project.

Expected Behavior

Yoga to be correctly imported.

Actual Behavior

__dirname is not defined in ES module scope

Note

It looks like it's the only issue that causes yoga-layout from working seamlessly in ESM environment.

@wojtekmaj
Copy link
Author

Appears to be related: emscripten-core/emscripten#12184

@NickGerleman
Copy link
Contributor

There's an upcoming change for the next major version of Yoga (releasing mid-feb), where we ended up making the JS bindings ES module compatible (and actually, only ES module compatible, for reasons around TLA and the future wasm module integration is going). ef1d772 is the commit that made that change.

This is not on the npmjs registry yet, and I still need to document that change when we do release notes, but I am fairly certain that would fix this issue (and will also break compat with CommonJS, unfortunately).

@NickGerleman
Copy link
Contributor

Going to close this out, since I think it should be fixed by the upcoming release, but let me know otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants