-
报错Expected '>', got 'v', Expected '>', got 'slot',Expected ';', '}' or import { defineConfig, loadEnv } from '@rsbuild/core'
import { pluginVue2 } from '@rsbuild/plugin-vue2'
import { pluginSass } from '@rsbuild/plugin-sass'
const { publicVars } = loadEnv({ prefixes: ['VUE_APP_'] })
const path = require('path')
export default defineConfig({
plugins: [pluginVue2(), pluginSass()],
source: {
define: publicVars,
// 指定入口文件
entry: {
index: './src/main.js',
},
},
html: {
template: './public/index.html',
},
dev: {
assetPrefix: true,
},
tools: {
rspack: {
resolve: {
alias: {
'@': path.resolve(__dirname, 'src'),
'@api': path.resolve(__dirname, 'api'),
'@models': path.resolve(__dirname, 'models'),
'@store': path.resolve(__dirname, 'store'),
'@settings': path.resolve(__dirname, 'config/settings'),
'@constants': path.resolve(__dirname, 'config/constants'),
'@assets': path.resolve(__dirname, 'assets'),
'@router': path.resolve(__dirname, 'router'),
'@views': path.resolve(__dirname, 'views'),
'@styles': path.resolve(__dirname, 'assets/styles'),
'@directives': path.resolve(__dirname, 'directives'),
'@filters': path.resolve(__dirname, 'filters'),
'@layouts': path.resolve(__dirname, 'layouts'),
'@utils': path.resolve(__dirname, 'utils')
}
},
},
}
}) ├─▶ × × Expected '>', got 'v'
│ │ ╭─[E:\lft\xxxx\glyh-web-admin\src\views\asset-management\operation-facilities\surveillance-center\add\index.vue:2:1]
│ │ 1 │
│ │ 2 │ <SavePage v-loading="loading" :title="title">
│ │ · ─
│ │ 3 │ <template v-if="type !== 'detail'" slot="buttons">
│ │ 4 │ <BaseButton :loading="submitLoading" @click="handleSubmit">保存</BaseButton>
│ │ 5 │ </template>
│ │ ╰────
│ │
│
╰─▶ Syntax Error
File: E:\lft\xxxx\glyh-web-admin\src\views\asset-management\operation-facilities\surveillance-center\index.vue?vue&type=template&id=2fe6bde9&scoped=true:1:1
× Module build failed:
├─▶ × × Expected '>', got 'slot'
│ │ ╭─[E:\lft\xxxx\glyh-web-admin\src\views\asset-management\operation-facilities\surveillance-center\index.vue:3:1]
│ │ 1 │
│ │ 2 │ <BasePage>
│ │ 3 │ <div slot="button">
│ │ · ────
│ │ 4 │ <BaseButton v-permission="{ btnCode: 'dlyh_c29_d123_2' }" style="margin-right: 8px" @click="handleAdd">新增</BaseButton>
│ │ 5 │ <ExcelImport v-permission="{ btnCode: 'dlyh_c29_d124_2' }" :model="model" @success="handleFilter"></ExcelImport>
│ │ 6 │ <BaseButton v-permission="{ btnCode: 'dlyh_c29_d125_2' }" type="second" :loading="downloadLoading" @click="handleDownload">导出</BaseButton>
│ │ ╰────
│ │
│
╰─▶ Syntax Error
File: E:\lft\xxxx\glyh-web-admin\src\views\setting\business\maintenance-project-approval\detail.vue?vue&type=template&id=3a5b7f4e&scoped=true:1:1
× Module build failed:
├─▶ × × Expression expected
│ │ ╭─[E:\lft\xxxx\glyh-web-admin\src\views\setting\business\maintenance-project-approval\detail.vue:2:1]
│ │ 1 │
│ │ 2 │ <el-dialog :title="title" width="40%" :close-on-click-modal="clickModal" :visible.sync="show" :destroy-on-close="true" class="add-dialog" @close="closeModal()">
│ │ · ─
│ │ 3 │ <el-form ref="maintenance-approver-form" :model="info" label-width="120px">
│ │ 4 │ <el-form-item label="项目名称:" prop="projectName">
│ │ 5 │ {{ info.projectName }}
│ │ ╰────
│ │ × Expected ';', '}' or <eof>
│ │ ╭─[E:\lft\xxxxx\glyh-web-admin\src\views\setting\business\maintenance-project-approval\detail.vue:2:1]
│ │ 1 │
│ │ 2 │ <el-dialog :title="title" width="40%" :close-on-click-modal="clickModal" :visible.sync="show" :destroy-on-close="true" class="add-dialog" @close="closeModal()">
│ │ · ───┬─── ─
│ │ · ╰── This is the expression part of an expression statement
│ │ 3 │ <el-form ref="maintenance-approver-form" :model="info" label-width="120px">
│ │ 4 │ <el-form-item label="项目名称:" prop="projectName">
│ │ 5 │ {{ info.projectName }}
│ │ ╰────
│ │
│
╰─▶ Syntax Error
File: E:\lft\xxxx\glyh-web-admin\src\store\modules\trafficIncident.js:1:1
× Module not found: Can't resolve '@models' in 'E:\lft\xxxx\glyh-web-admin\src\store\modules'
╭─[6:37]
4 │ import store from '../index';
5 │ import useConfirm from '@/hooks/useConfirm';
6 │ import { TrafficIncidentModel } from '@models';
· ─────────
7 │ var trafficIncidentModel = new TrafficIncidentModel();
8 │ var defaultState = function() {
╰────
File: E:\lft\xxxx\glyh-web-admin\src\store\modules\user.js:1:1
× Module not found: Can't resolve '@utils/auth' in 'E:\lft\xxxx\glyh-web-admin\src\store\modules'
╭─[1:38]
1 │ import { getToken, removeToken } from '@utils/auth';
· ─────────────
2 │ import { processPermission, resetRoutes } from '@router';
3 │ var defaultState = function() {
╰────
File: E:\lft\xxxx\glyh-web-admin\src\store\modules\user.js:1:1
× Module not found: Can't resolve '@router' in 'E:\lft\xxxx\glyh-web-admin\src\store\modules'
╭─[2:47]
1 │ import { getToken, removeToken } from '@utils/auth';
2 │ import { processPermission, resetRoutes } from '@router';
· ─────────
3 │ var defaultState = function() {
4 │ return {
╰──── |
Beta Was this translation helpful? Give feedback.
Answered by
pcdeng
Nov 11, 2024
Replies: 1 comment 1 reply
-
I also encountered the same problem and created a project to reproduce it https://github.com/pcdeng/rsbuild-vue2-demo |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
yc0123450
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I also encountered the same problem and created a project to reproduce it https://github.com/pcdeng/rsbuild-vue2-demo