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

Webpack example #189

Closed
0michalsokolowski0 opened this issue Jul 24, 2021 · 8 comments
Closed

Webpack example #189

0michalsokolowski0 opened this issue Jul 24, 2021 · 8 comments

Comments

@0michalsokolowski0
Copy link

Hello,

I spent a couple of hour trying make import work without any success. When I trying to import any function e.g. "encrypt" I am getting undefined.

Could you provide an example of usage with any Webpack based project?
In my case example with create-react-app for instance would be extremely helpful.

@michaelfarrell76
Copy link
Member

did you see this? https://github.com/transcend-io/penumbra#webpack

@0michalsokolowski0
Copy link
Author

Yes, I did see this. But still I wasn't able to make it work.

@0michalsokolowski0
Copy link
Author

It might be enough for production build, but still how I am supposed to use it with webpack-server.
For me it is far from clear and unfortunately it make the lib unusable for me.

@michaelfarrell76
Copy link
Member

@0michalsokolowski0 sorry to hear that! the crypto operations are quick heavy and so we had to bundle the code into a web worker which is non trivial to bundle with webpack.

i can help you debug if you share more information on the error you are seeing and the webpack config you have

@0michalsokolowski0
Copy link
Author

Thanks for the quick response.
My problem is pretty simple, I have an application created with CRA (example) I am trying to import penumbra, then I am getting error:
Cannot read property 'encrypt' of undefined.

My primary issue is how to bundle the library into my app with webpack-dev-server to run it locally.
I've spent quite a lot of time trying to accomplish this (even with CRA ejected) without success.. 😞

@michaelfarrell76
Copy link
Member

@0michalsokolowski0 penumbra requires additional webpack/HTML setup outside of just the npm import. im not too familiar with create react app, but i was able to get it working here: https://codesandbox.io/s/cranky-browser-2mh68?file=/src/App.tsx its not the prettiest but it works!

@michaelfarrell76
Copy link
Member

#75

@michaelfarrell76
Copy link
Member

@0michalsokolowski0 gonna close this for now since the example is there but please re-open and ping me if you cant get this to work with that example!

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