The Stack Snippet I included in this question sometimes produces the QR code as expected, but sometimes throws an error.

When I was preparing the code snippet, it worked well. But now, after it has been posted, it isn't working reliably.

What did I do wrong, and how can I fix it?

enter image description here

share

put on hold as off-topic by Cerbrus, CodeCaster, Toto, Veve, Cody Gray 5 hours ago

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "The problem described here can no longer be reproduced. Changes to the system or to the circumstances affecting the asker have rendered it obsolete. If you encounter a similar problem, please post a new question." – Cerbrus, CodeCaster, Toto, Veve, Cody Gray
If this question can be reworded to fit the rules in the help center, please edit the question.

    
Define "doesn't work". – Maroun Maroun 6 hours ago
1  
For whatever it's worth, it reliably generates the QR code for me (Safari on OS X and Waterfox on Win 7). – Cody Gray 6 hours ago
    
@MarounMaroun Sometimes the QR code is generated, mostly this error. "message": "Uncaught TypeError: url.createObjectURL is not a function", – ARUN Edathadan 6 hours ago

So your original problem is that the browser throws an error while developing and testing this code. You then decided to ask a question using the same code, and the error is reproducible using Stack Snippets.

So far so good, but why would this be a problem with Stack Snippets? If this issue occurs while running your original code as well as when running it in a snippet, then obviously the snippet part isn't relevant.

The problem is in your code, and it most likely is that window.URL is (sometimes) overwritten.

share
    
I think there is some configuration issues with my pc. – ARUN Edathadan 6 hours ago
    
Caster Thanks, going to remove this. – ARUN Edathadan 6 hours ago
    
Just be sure to update your question on main. :) – CodeCaster 6 hours ago
    
Well if you're not going to remove it, let me undelete my answer. – CodeCaster 5 hours ago
    
I didn't notice the upvote. – ARUN Edathadan 5 hours ago

Not the answer you're looking for? Browse other questions tagged .