HalseySpicy / Geeker-Admin

✨✨✨ Geeker Admin,基于 Vue3.4、TypeScript、Vite5、Pinia、Element-Plus 开源的一套后台管理框架。
https://admin.spicyboy.cn
MIT License
7.16k stars 1.51k forks source link

vite版本自行升级出现TypeError: isFunction is not a function #476

Closed 48038411 closed 2 months ago

48038411 commented 2 months ago

作者您好,使用您的框架很久了,但是一直没做更新操作,最近遇到了动态页面切换后空白的问题,在您的issue列表中找了一下发现您在2023.12.02回复的vite5版本已经修复,但是由于我download的您的版本距离您的更新已经差的太远,所以从您的项目Git提交历史中看了2023.12.02的提交,在自己的项目中进行了更改。原先vite版本是4.1.4,按照您的package.json升级到了5.0.4,在package.json中添加了"type": "module",并把js文件替换成了.cjs文件,没有参考您的代码做build目录下的单独文件。现在启动后前端报错 image image package.json文件是{ "name": "moutain-sea-admin", "author": "isabel <1660478286@qq.com>", "private": true, "version": "0.0.0", "type": "module", "scripts": { "dev": "vite --mode dev", "ts:check": "vue-tsc --noEmit", "serve:dev": "vite preview --mode dev", "serve:test": "vite preview --mode test", "serve:pro": "vite preview --mode pro", "build:dev": "npm run ts:check && vite build --mode dev", "build:test": "vite build --mode test", "build:pro": "vite build --mode pro", "lint:eslint": "eslint --fix --ext .js,.ts,.vue ./src", "lint:prettier": "prettier --write --loglevel warn \"src/**/*.{js,ts,json,tsx,css,less,vue,html,md}\"", "lint:style": "stylelint --fix \"**/*.{vue,less,postcss,css,scss}\" --cache --cache-location node_modules/.cache/stylelint/", "lint:lint-staged": "lint-staged -c .husky/lintstagedrc.cjs", "clean": "npx rimraf node_modules", "clean:cache": "npx rimraf node_modules/.cache", "prepare": "husky install", "analysis": "windicss-analysis" }, "dependencies": { "@alicloud/sts20150401": "^1.1.4", "@amap/amap-jsapi-loader": "^1.0.1", "@element-plus/icons-vue": "^2.3.1", "@vueuse/core": "^10.9.0", "@wangeditor/editor": "^5.1.23", "@wangeditor/editor-for-vue": "^5.1.12", "ali-oss": "^6.20.0", "axios": "^1.7.2", "crypto-js": "^4.2.0", "echarts": "^5.5.0", "echarts-liquidfill": "^3.1.0", "element-plus": "^2.7.5", "js-md5": "^0.7.3", "json-format": "^1.0.1", "lodash": "^4.17.21", "lodash-es": "^4.17.21", "mitt": "^3.0.0", "nprogress": "^0.2.0", "pinia": "^2.1.3", "pinia-plugin-persistedstate": "^3.1.0", "print-js": "^1.6.0", "sm-crypto": "^0.3.13", "sortablejs": "^1.15.0", "tunnel": "^0.0.6", "vue": "^3.3.4", "vue-i18n": "^9.2.2", "vue-pdf-embed": "1.2.1", "vue-router": "^4.2.1", "vue-types": "^5.0.3", "vue3-pdfjs": "^0.1.6", "web-storage-cache": "^1.1.1" }, "devDependencies": { "@commitlint/cli": "^17.6.3", "@commitlint/config-conventional": "^17.6.3", "@eslint/js": "^9.1.1", "@intlify/unplugin-vue-i18n": "^0.10.0", "@purge-icons/generated": "^0.9.0", "@types/crypto-js": "^4.2.2", "@types/node": "^18.16.14", "@types/nprogress": "^0.2.0", "@types/sortablejs": "^1.15.1", "@typescript-eslint/eslint-plugin": "^5.59.7", "@typescript-eslint/parser": "^5.59.7", "@vitejs/plugin-vue": "^4.2.3", "@vitejs/plugin-vue-jsx": "^3.0.1", "autoprefixer": "^10.4.14", "cz-git": "^1.6.1", "el-tree-select": "^3.1.14", "eslint": "^8.57.0", "eslint-config-prettier": "^8.8.0", "eslint-define-config": "^1.20.0", "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-vue": "^9.25.0", "globals": "^15.1.0", "husky": "^8.0.3", "i": "^0.3.7", "less": "^4.1.3", "lint-staged": "^13.2.2", "mockjs": "^1.1.0", "pdfjs-dist": "^4.4.168", "postcss": "^8.4.23", "postcss-html": "^1.5.0", "postcss-less": "^6.0.0", "prettier": "^2.8.8", "rimraf": "^5.0.1", "rollup": "3.17.3", "sass": "^1.77.1", "stylelint": "^14.16.1", "stylelint-config-html": "^1.1.0", "stylelint-config-prettier": "^9.0.5", "stylelint-config-recommended": "^9.0.0", "stylelint-config-standard": "^29.0.0", "stylelint-order": "^5.0.0", "terser": "^5.18.1", "typescript": "^4.9.5", "typescript-eslint": "^7.8.0", "vite": "5.0.4", "vite-plugin-auto-i18n": "^0.0.9", "vite-plugin-eslint": "^1.8.1", "vite-plugin-mock": "^2.9.8", "vite-plugin-progress": "^0.0.7", "vite-plugin-svg-icons": "^2.0.1", "vite-plugin-windicss": "^1.9.0", "vue-tsc": "^1.6.5", "windicss": "^3.5.6", "windicss-analysis": "^0.3.5" }, "config": { "commitizen": { "path": "node_modules/cz-git" } } } 您有空的时候帮忙看一下

48038411 commented 2 months ago

这个问题解决了,在main.ts把import { createApp } from 'vue'; 放到最上面即可。不过好像还是没有解决,vite当前版本是5.2.6

48038411 commented 2 months ago
  <transition appear name="fade-transform" mode="out-in">
    <Suspense>
      <keep-alive :include="keepAliveName">
        <component :is="Component" :key="route.fullPath" v-if="isRouterShow" />
      </keep-alive>
    </Suspense>
  </transition>外面套了个Suspense好了