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

Runtime error for web 5.0 #320

Closed
tmtong opened this issue Oct 25, 2021 · 10 comments
Closed

Runtime error for web 5.0 #320

tmtong opened this issue Oct 25, 2021 · 10 comments

Comments

@tmtong
Copy link

tmtong commented Oct 25, 2021

~/Documents/flutter_secure_storage/flutter_secure_storage/example$ flutter build web --web-renderer html --release

~/Documents/flutter_secure_storage/flutter_secure_storage/example$ sudo cp -r ./build/web/* ~/Documents/www/

image

I got in the browser console
Uncaught TypeError: Cannot read property 'generateKey' of undefined

@JohnGalt1717
Copy link

What happens when you run it in a real debugger?

Note this requires a browser that has the full crypto library which Brave may not have enabled.

@juliansteenbakker
Copy link
Collaborator

I advise testing in another browser. I am closing this for now. If this issue still exists please comment.

@henry2man
Copy link

I advise testing in another browser. I am closing this for now. If this issue still exists please comment.

I'm facing also this issue in my deployment using latest 5.0.2 version.

The issue is present only when the app is built, not in development mode.

@juliansteenbakker
Copy link
Collaborator

@henry2man which browser are you using?

@henry2man
Copy link

Stable Chrome 96.0.4664.55 w/ MacOS Monterrey on M1

The issue is also present in Safari

@henry2man
Copy link

@henry2man which browser are you using?

@juliansteenbakker Do you want me to do a specific test with my setup to see if we can have a minimum case from which to test? Any example or test of the plugin?

@juliansteenbakker
Copy link
Collaborator

juliansteenbakker commented Nov 23, 2021

After some searching it seems that webCrypto only works when the site is running HTTPS or localhost. How are you running your build?

Source: ipfs/js-ipfs#964 (comment)

@henry2man
Copy link

That's the key. For now I'm developing so I'm using localhost && HTTP only.

I think this should be documented in README.md, isn't it?

Thank you very much.

@juliansteenbakker
Copy link
Collaborator

Yes indeed, thanks for the verification !

@juliansteenbakker
Copy link
Collaborator

I have added the note in the readme doc.

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

4 participants