vuejs / repl

Vue SFC REPL as a Vue 3 component
https://repl-vuejs.vercel.app
MIT License
904 stars 159 forks source link

opening Vue SFC Playground with malformed link causes webpage to not load #256

Closed eugritz closed 3 months ago

eugritz commented 3 months ago

Vue version

doesn't matter

Link to minimal reproduction

https://play.vuejs.org/#eNp9kUFLwzAUx7/KM5cqzBXR0+gGKgP1oKKCl1xG99ZlpklIXuag9Lv7krK5w9it7//7v/SXthP3zo23EcVEVKH2yhEEpOhm0qjWWU/QgccV9LDytoWCq4U00tTWBII2NDBN/LJ4Qq0tfFuvlxfFlTRVORzHB/FA2Dq9IOQJoFrfzLouL/d9VfKUU2VcJNhet3aJeioFcymgZFiVR/tiJCjw61eqGW+CNWzepX0pats6pdG/OVKsJ8UEMklswXa/LzkjH3G0z+s11j8n8k3YpUyKd48B/RalODBa+AZpwPPPV9zx8wGyfdTcPgM/MFgdk+NQe4hmydpHvWz7nL+/Ms1XmO8ITdhfKommZp/7UvA/eTxz9X/d2/Fd3pOmF/0fEx+nNQ=

Steps to reproduce

  1. open Vue SFC Playground https://play.vuejs.org
  2. wait untill page loads and url changes
  3. copy url
  4. paste url to new tab and remove last character or few

What is expected?

Working page with an error message that source in URL is incorrectly encoded.

What is actually happening?

Page doesn't load at all. Console logs are

index-DoexIJJo.js:13 DOMException: Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.
    at cOe (https://play.vuejs.org/assets/index-DoexIJJo.js:256:15072)
    at I (https://play.vuejs.org/assets/index-DoexIJJo.js:841:3009)
    at Ehe (https://play.vuejs.org/assets/index-DoexIJJo.js:841:3457)
    at setup (https://play.vuejs.org/assets/index-DoexIJJo.js:1558:10384)
    at gp (https://play.vuejs.org/assets/index-DoexIJJo.js:13:38)
    at hye (https://play.vuejs.org/assets/index-DoexIJJo.js:13:40035)
    at uye (https://play.vuejs.org/assets/index-DoexIJJo.js:13:39814)
    at $ (https://play.vuejs.org/assets/index-DoexIJJo.js:13:28071)
    at R (https://play.vuejs.org/assets/index-DoexIJJo.js:13:27944)
    at p (https://play.vuejs.org/assets/index-DoexIJJo.js:13:24395)

System Info

No response

Any additional comments?

First time I encountered this error while I was writing code in Vue SFC Playground and the page suddenly crashed (?). I wasn't able to open devtools and copy-pasting same link and opening new tab resulted this behaviour.

Second time I encountered this error while I was pasting links in Telegram, which didn't highlight the whole link (probably because it has some sort of max link length).