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 module import problem with js-sha256 #675

Open
TrentBrown opened this issue Jan 5, 2023 · 2 comments
Open

Fix module import problem with js-sha256 #675

TrentBrown opened this issue Jan 5, 2023 · 2 comments

Comments

@TrentBrown
Copy link

TrentBrown commented Jan 5, 2023

Describe the bug

When serving a web app with web-dev-server, attempting to import a backend description file results in a runtime syntax error at the point where the @dfinity/agent tries to load the js-sha256 code.

To Reproduce

I created the most minimal example of what I'm seeing and pushed the project up to my GitHub account here. The ReadMe there has the steps to reproduce:

CleanShot_2023-01-04_at_15 48 39

For reference, this is the Discord conversation I had with Kyle in the #ask-questions Discord channel.

@TrentBrown
Copy link
Author

I see that Rollup is also not happy. Emits the same complaint when I try to build a distribution:

CleanShot 2023-01-04 at 17 08 09

@krpeacock
Copy link
Contributor

It's an odd issue, because it definitely is exported by the module. I've looked into it, and it's not trivially easy to modify the source code of js-sha256, because of some strange choices they made in designing their package modularization system

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

No branches or pull requests

2 participants