小编Swa*_*nil的帖子

内部服务器错误:无法读取未定义的属性“长度”

出现错误

[vite] 内部服务器错误:无法读取未定义的属性“长度”

这是在尝试使用 vite 运行我的 vue 项目时发生的。

下面是错误堆栈:

构建失败,出现 1 个错误:node_modules/vite/dist/node/chunks/dep-27bc1ab8.js:59574:34: 错误: [插件: vite:dep-scan] 无法读取未定义 2:44:29 的属性“长度” PM [vite] 内部服务器错误:无法读取匹配处未定义的属性“长度”(/Users/pandocorp/Desktop/pando/codes/pando-app/frontend/shipper/node_modules/vite/dist/node/chunks/dep- 27bc1ab8.js:59574:35) 在 /Users/pandocorp/Desktop/pando/codes/pando-app/frontend/shipper/node_modules/vite/dist/node/chunks/dep-27bc1ab8.js:59633:58 在数组。 find () 在 Context.resolveId (/Users/pandocorp/Desktop/pando/codes/pando-app/frontend/shipper/node_modules/vite/dist/node/chunks/dep-27bc1ab8.js:59633:42) 处的对象。在 processTicksAndRejections (internal/process/task_queues. js:95:5) 在异步 ModuleGraph.resolveUrl (/Users/pandocorp/Desktop/pando/codes/pando-app/frontend/shipper/node_modules/vite/dist/node/chunks/dep-27bc1ab8.js:56244:26 )在异步 ModuleGraph.getModuleByUrl (/Users/pandocorp/Desktop/pando/codes/pando-app/frontend/shipper/node_modules/vite/dist/node/chunks/dep-27bc1ab8.js:56124:23)在异步 doTransform ( /Users/pandocorp/Desktop/pando/codes/pando-app/frontend/shipper/node_modules/vite/dist/node/chunks/dep-27bc1ab8.js:55582:20)

我的 vite.config.js

import { defineConfig } from 'vite';
import { createVuePlugin } from 'vite-plugin-vue2';

const config = require('./config');
const path = require('path');

export default defineConfig({
plugins: [createVuePlugin()],
server: {
port: 8080,
},
resolve: {
alias: [
{ …
Run Code Online (Sandbox Code Playgroud)

vue.js vite

7
推荐指数
1
解决办法
6419
查看次数

标签 统计

vite ×1

vue.js ×1