gpt4 book ai didi

vue.js - Vuetify SassError : Expected identifier

转载 作者:行者123 更新时间:2023-12-04 11:52:50 25 4
gpt4 key购买 nike

sass 文件 Vuetify 内部出错。我试图将依赖项放在版本下方,但没有帮助。该怎么办?

ERROR in ./node_modules/vuetify/src/styles/main.sass (./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!./node_modules/postcss-loader/src??ref--6-oneOf-1-2!./node_modules/sass-loader/dist/cjs.js??ref--6-oneOf-1-3!./node_modules/sass-resources-loader/lib/loader.js??ref--6-oneOf-1-4!./node_modules/vuetify/src/styles/main.sass)
Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Expected identifier.

34 │ .v-application .red.#E82550{
│ ^

node_modules/vuetify/src/styles/generic/_colors.scss 34:29 @import
node_modules/vuetify/src/styles/generic/_index.scss 2:9 @import
node_modules/vuetify/src/styles/main.sass 38:9 root stylesheet
请看我的 Package.json
{
"name": "test",
"version": "1.0.0",
"private": true,
"scripts": {
"dev": "nuxt",
"build": "nuxt build",
"start": "nuxt start",
"generate": "nuxt generate"
},
"dependencies": {
"@nuxtjs/axios": "^5.12.2",
"@nuxtjs/dotenv": "^1.4.1",
"@nuxtjs/laravel-echo": "^1.1.0",
"@nuxtjs/style-resources": "^1.0.0",
"@nuxtjs/svg": "^0.1.12",
"cookie-universal-nuxt": "^2.1.4",
"core-js": "^3.7.0",
"lodash.clonedeep": "^4.5.0",
"nuxt": "^2.14.7",
"pusher-js": "^7.0.1",
"vue-fullscreen": "^2.1.6",
"vue-perfect-scrollbar": "^0.2.1"
},
"devDependencies": {
"@babel/core": "^7.12.9",
"@nuxt/types": "^2.14.7",
"@nuxtjs/vuetify": "^1.11.2",
"babel-loader": "^8.2.1",
"node-sass": "^4.14.1",
"sass-loader": "^10.0.2"
}
}
nuxt.config.js
export default {
// Disable server-side rendering (https://go.nuxtjs.dev/ssr-mode)
ssr: false,

// Global page headers (https://go.nuxtjs.dev/config-head)
head: {
title: 'nlmk--front',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: '' }
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
]
},

styleResources: {
sass: [
'./assets/styles/sass/_variables.sass',
'./assets/styles/sass/_mixins.sass',
]
},

// Global CSS (https://go.nuxtjs.dev/config-css)
css: [
'./assets/styles/sass/_reset.sass',
'./assets/fonts/roboto/roboto.css',
'./assets/styles/sass/default.sass',
],

// Plugins to run before rendering page (https://go.nuxtjs.dev/config-plugins)
plugins: [
'~/plugins/resize',
//'~/plugins/vuetify',
'~/plugins/fullscreen'
],
vuetify: {},
// Auto import components (https://go.nuxtjs.dev/config-components)
components: true,

// Modules for dev and build (recommended) (https://go.nuxtjs.dev/config-modules)
buildModules: [
'@nuxtjs/vuetify',
],
// Modules (https://go.nuxtjs.dev/config-modules)
modules: [
// https://go.nuxtjs.dev/axios
'@nuxtjs/axios',
'@nuxtjs/svg',
'@nuxtjs/style-resources',
'cookie-universal-nuxt',
'@nuxtjs/laravel-echo',
],

// Axios module configuration (https://go.nuxtjs.dev/config-axios)
axios: {
debug: false,
retry: { retries: 3 },
baseURL: process.env.API_URL
},

// Build Configuration (https://go.nuxtjs.dev/config-build)
build: {
extend(config, { isDev, isClient, isServer }) {
if (!isDev) {
config.output.publicPath = '/_nuxt/'
}
}
}
}
sass 文件 Vuetify 内部出错。我试图将依赖项放在版本下方,但没有帮助。该怎么办?
enter image description here

最佳答案

有类似的错误。这很烦人,因为它带有“默认”项目 vue create prj/vue add vuetify从 vuetify 页面复制粘贴 v-select 的示例后...
我看过的其他帖子建议使用 sass 而不是 node-sass,但我已经在这样做了。 (检查您项目的 package.json 文件)
我发现我遇到的类似问题的解决方案是安装旧版本的 sass:

npm install sass@1.32.8

关于vue.js - Vuetify SassError : Expected identifier,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65003886/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com