vuejs / router

🚦 The official router for Vue.js
https://router.vuejs.org/
MIT License
3.95k stars 1.19k forks source link

CodeSandbox playground in README broken due to not loading vue #2342

Closed BobbieGoede closed 3 months ago

BobbieGoede commented 3 months ago

Reproduction

https://codesandbox.io/p/sandbox/vue-router-4-reproduction-hb9lh

Steps to reproduce the bug

  1. Open the playground referenced from the README https://github.com/vuejs/router/blob/main/README.md?plain=1#L74
  2. Note that the links in the page do not work
  3. Check the console logs to find the following errors logged:
    Uncaught ReferenceError: Vue is not defined
    <anonymous> https://unpkg.com/vue-router@next:3605
    [vue-router@next:3605:8](https://unpkg.com/vue-router@next)
    <anonymous> https://unpkg.com/vue-router@next:3605
    Uncaught TypeError: VueRouter is undefined
    <anonymous> https://hb9lh.csb.app/:25

Expected behavior

The sandbox working

Actual behavior

Sandbox does not load Vue and breaks the initialization of VueRouter.

It's broken because this <script src="https://unpkg.com/vue@next"></script> does not actually load Vue as https://unpkg.com/vue@next does not resolve a Vue version (responds with Cannot find package vue@next).

It seems this needs to be replaced with either https://unpkg.com/vue@latest or https://unpkg.com/vue@3 as these do work.

Additional information

This is not really related to the repo/package code 😅

posva commented 3 months ago

Fixed