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

通过cdn引入vue时,stack-keep-alive会报错 #17

Open
DonMillion opened this issue Mar 15, 2024 · 0 comments
Open

通过cdn引入vue时,stack-keep-alive会报错 #17

DonMillion opened this issue Mar 15, 2024 · 0 comments

Comments

@DonMillion
Copy link

最近为了优化加载速度,把部分库放到cdn上,用的是 vite-plugin-cdn-import 的 importToCDN 方法,把vue相关的代码放上了cdn,这时候 stack-keep-alive 还没放到cdn,打开应用正常,但是跳转就会报错,

vue.global.prod.js:6 TypeError: Failed to execute 'insertBefore' on 'Node': parameter 1 is not of type 'Node'.
    at insert (vue.global.prod.js:8:35943)
    at W (vue.global.prod.js:8:26140)
    at W (vue.global.prod.js:8:25803)
    at W (vue.global.prod.js:8:25646)
    at W (vue.global.prod.js:8:25646)
    at i.deactivate (library.esm.js:1:10668)
    at K (vue.global.prod.js:8:26316)
    at y (vue.global.prod.js:8:16400)
    at ue.c [as fn] (vue.global.prod.js:8:22255)
    at ue.run (vue.global.prod.js:6:6583)
importToCDN({
        modules: [
          {
            name:'vue',
            var:'Vue',
            path:`${cdnjsLink}vue/3.4.21/dist/vue.global.prod.js`
          },
          {
            name: 'vue-demi',
            var: 'VueDemi',
            path: `${pubCDN}vue-demi/0.13.11/index.iife.min.js`
          },
          {
            name:'pinia',
            var:'Pinia',
            path:`${pubCDN}pinia/2.0.21/pinia.iife.prod.min.js`
          },
          {
            name:'vue-router',
            var:'VueRouter',
            path:`${pubCDN}vue-router/4.1.5/vue-router.global.prod.min.js`
          },
          {
            name: 'lodash',
            var: '_',
            path: `${cdnjsLink}lodash/4.17.21/lodash.min.js`
          },
        ]
      })

引入 /dist/library.esm.js 时,报

@DonMillion DonMillion changed the title 通过cdn引入时, 引入三个文件都报错 通过cdn引入vue时,stack-keep-alive会报错 Mar 15, 2024
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

1 participant