Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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 wasm-pack@0.10.3 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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.