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

fix: use dynamic import for node-specific libraries #820

Merged
merged 3 commits into from
Nov 18, 2024

Conversation

kanadgupta
Copy link
Member

@kanadgupta kanadgupta commented Nov 16, 2023

🧰 Changes

I went down a little rabbit hole to see how it would work to load these SDKs in a browser environment as part of the docs I want to write up. The closest I got to success was this error (even with a webpack config and various tweaks to it):

CleanShot 2023-11-16 at 10 31 50@2x

Looks like the same error alluded to here: #604 (comment)

I figured that by only loading the node-specific libraries within the function that needs it, we might be able to successfully run this in a browser environment?

🧬 QA & Testing

I was unable to successfully npm link this into my setup in a way that played nicely with webpack so hard to see if this will work. Open to other ideas here!

@kanadgupta
Copy link
Member Author

Update: chatted with @erunion about this a while back and we might be able to bring in the datauri methods that we use directly — will pick this up when I have capacity again!

marcusrbrown added a commit to bfra-me/works that referenced this pull request Oct 14, 2024
@joaocanaverde-blue
Copy link

@kanadgupta @erunion Hi! Any chance this can be merged? Happy to contribute if anything is needed.

@kanadgupta kanadgupta added the bug Something isn't working label Nov 18, 2024
@kanadgupta kanadgupta marked this pull request as ready for review November 18, 2024 15:00
@kanadgupta kanadgupta requested a review from erunion November 18, 2024 15:00
@kanadgupta
Copy link
Member Author

@erunion ready for review again. I tried playing around with vendoring datauri but it felt like overkill since we'd need to create a separate subpackage for it since it's used in both core and testing-utils

@kanadgupta kanadgupta merged commit b338098 into main Nov 18, 2024
6 checks passed
@kanadgupta kanadgupta deleted the await-import-node-specific-functions branch November 18, 2024 15:10
@kanadgupta
Copy link
Member Author

Hi there @joaocanaverde-bluev7.0.0-beta.11 includes this change.

@joaocanaverde-blue
Copy link

@kanadgupta thank you! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants