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

Update wasm-bindgen and wasm-pack #908

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mtoohey31
Copy link

I believe this should resolve the wasm-related errors I mentioned in #888. My specific project appears to work correctly after these changes. Other than building the code and using it my project though, I haven't tested anything else, so lmk if there's anything else I need to check. Thanks!

Closes #888.

Copy link
Owner

@JohnnyMorganz JohnnyMorganz left a comment

Choose a reason for hiding this comment

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

Thanks for this!

npx [email protected] build --target web --out-dir wasm/stylua.web -- --features lua52,lua53,lua54,luau

# workaround for bundler usage
echo "export { getImports as __getImports, finalizeInit as __finalizeInit }" >> wasm/stylua.web/stylua_lib.js
Copy link
Owner

Choose a reason for hiding this comment

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

How come we are removing this line?

Copy link
Author

Choose a reason for hiding this comment

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

Good question, now that you mention this I've realized that other files in the parent directory seem to depend on these exports. The issue is the file which is generated by the latest version of wasm-pack doesn't contain getImports or finalizeInit. I'm not exactly clear on what these were actually for though...

So I've converted this to a draft for now. I'm kinda busy right now so it might be a little bit before I can dig into this and figure out what those were for.

@mtoohey31 mtoohey31 marked this pull request as draft November 11, 2024 23:58
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.

Update wasm-bindgen and wasm-pack to resolve ReferenceError
2 participants