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

router is not found! In unit test mode ,router is got from gloabl.router, otherwise VueRouter.useRouter(),test环境没问题,其他环境报这个 #11

Open
SproutingChickenTeam opened this issue Nov 4, 2022 · 10 comments

Comments

@SproutingChickenTeam
Copy link

No description provided.

@SproutingChickenTeam SproutingChickenTeam changed the title router is not found! In unit test mode ,router is got from gloabl.router, otherwise VueRouter.useRouter() router is not found! In unit test mode ,router is got from gloabl.router, otherwise VueRouter.useRouter(),test环境没问题,其他环境报这个 Nov 4, 2022
@Zippowxk
Copy link
Owner

Zippowxk commented Nov 4, 2022

反馈收到

@SproutingChickenTeam
Copy link
Author

image
image

急急急!!!

@SproutingChickenTeam
Copy link
Author

反馈收到

但是env为test就没问题
webpack打包方式,vite也没问题

@Zippowxk
Copy link
Owner

Zippowxk commented Nov 4, 2022

你好 你使用的各个依赖包的版本是?

@Zippowxk
Copy link
Owner

Zippowxk commented Nov 4, 2022

建议参考一下例子: https://github.com/Zippowxk/stack-keep-alive-sample ,例子中使用webpack打包 ,目前已经正常托管在github上了 http://xinkai.wang/stack-keep-alive-sample/dist/

@SproutingChickenTeam
Copy link
Author

SproutingChickenTeam commented Nov 4, 2022

建议参考一下例子: https://github.com/Zippowxk/stack-keep-alive-sample ,例子中使用webpack打包 ,目前已经正常托管在github上了 http://xinkai.wang/stack-keep-alive-sample/dist/

只加了一个环境变量,就报错了

image

stack-keep-alive-sample-main 2.zip

@SproutingChickenTeam
Copy link
Author

???

@Zippowxk
Copy link
Owner

Zippowxk commented Nov 8, 2022

建议参考一下例子: https://github.com/Zippowxk/stack-keep-alive-sample ,例子中使用webpack打包 ,目前已经正常托管在github上了 http://xinkai.wang/stack-keep-alive-sample/dist/

只加了一个环境变量,就报错了

image

stack-keep-alive-sample-main 2.zip

此处导致此问题的原因是 debug文件不存在,已更新main分支,剔除了debug相关的代码

@Zippowxk
Copy link
Owner

在main.js中使用以下代码 替换,可解决此问题

import { createApp } from 'vue/dist/vue.esm-bundler.js';
import StackKeepAlive from 'stack-keep-alive/dist/library.esm';

@Zippowxk
Copy link
Owner

@SproutingChickenTeam 您可以试一下

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

2 participants