Последние несколько часов я искал ответы в Интернете. Я собираюсь сходить с ума.
У меня есть новый проект Vue, который я начал с vue-cli
, и добавил Vuetify. Когда я запускаю yarn serve
, я получаю сотню ошибок с жалобами:
ERROR Failed to compile with 100 errors 2:02:26 PM
error in ./node_modules/vuetify/src/components/VColorPicker/VColorPickerSwatches.sass
Module build failed (from ./node_modules/sass-loader/lib/loader.js):
^
Expected newline.
╷
6 │ var content = require("!!../../../../css-loader/dist/cjs.js!../../../../sass-loader/lib/loader.js??ref--14-2!./VColorPickerSwatches.sass");
│ ^
╵
stdin 6:139 root stylesheet
in /Users/jimmiejackson/Documents/repositories/gear_closet/frontend/node_modules/vuetify/src/components/VColorPicker/VColorPickerSwatches.sass (line 6, column 139)
@ ./node_modules/vuetify/src/components/VColorPicker/VColorPickerSwatches.sass 4:14-343 14:3-18:5 15:22-351
@ ./node_modules/vuetify/lib/components/VColorPicker/VColorPickerSwatches.js
@ ./node_modules/vuetify/lib/components/VColorPicker/VColorPicker.js
@ ./node_modules/vuetify/lib/components/VColorPicker/index.js
@ ./node_modules/vuetify/lib/components/index.js
@ ./node_modules/vuetify/lib/index.js
@ ./src/plugins/vuetify.js
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://192.168.1.84:8080/sockjs-node (webpack)/hot/dev-server.js ./src/main.js
Я пытался обновить / понизить sass-loader
, удалить node-sass
и различные конфигурации Webpack (через vue.config.js
),У кого-нибудь есть решение?
main.js
import Vue from 'vue';
import vueHeadful from 'vue-headful';
import vuetify from './plugins/vuetify';
import App from './App.vue';
import router from './router';
import store from './store/index';
Vue.config.productionTip = false;
Vue.component('vue-headful', vueHeadful);
new Vue({
router,
store,
vuetify,
render: h => h(App),
}).$mount('#app');
vuetify.js
import Vue from 'vue';
import Vuetify from 'vuetify/lib';
import Unicon from 'vue-unicons';
import { uniCarWash } from 'vue-unicons/src/icons';
Vue.use(Vuetify);
Unicon.add([uniCarWash]);
Vue.use(Unicon);
export default new Vuetify({
icons: {
iconfont: 'uni',
},
});
vue.config.js
const path = require('path');
module.exports = {
transpileDependencies: [
'vuetify',
],
css: {
loaderOptions: {
sass: {
data: `@import "~/scss/variables.scss"`,
},
},
},
chainWebpack: config => {
["vue-modules", "vue", "normal-modules", "normal"].forEach(match => {
config.module.rule('scss').oneOf(match).use('sass-loader')
.tap(opt => Object.assign(opt, { data: `@import '~@/scss/variables.scss';` }));
});
},
configureWebpack: {
resolve: {
alias: {
'~': path.resolve(__dirname, './src/'),
},
extensions: ['*', '.js', '.vue', '.json'],
},
module: {
rules: [
{
test: /\.s(c|a)ss$/,
use: [
'vue-style-loader',
'css-loader',
{
loader: 'sass-loader',
options: {
implementation: require('sass'),
fiber: require('fibers'),
},
},
],
},
],
},
},
};
package.json
{
"name": "newapp",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"axios": "^0.19.0",
"core-js": "^2.6.5",
"css-loader": "^3.2.0",
"style-loader": "^1.0.0",
"vee-validate": "^3.0.11",
"vue": "^2.6.10",
"vue-headful": "^2.0.1",
"vue-loader": "^15.7.1",
"vue-router": "^3.0.3",
"vuetify": "^2.1.0",
"vuex": "^3.0.1"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^3.12.0",
"@vue/cli-plugin-eslint": "^3.12.0",
"@vue/cli-service": "^3.12.0",
"@vue/eslint-config-airbnb": "^4.0.0",
"babel-eslint": "^10.0.1",
"deepmerge": "^4.1.1",
"eslint": "^5.16.0",
"eslint-import-resolver-webpack": "^0.11.1",
"eslint-plugin-vue": "^5.0.0",
"fibers": "^4.0.1",
"path": "^0.12.7",
"sass": "^1.17.4",
"sass-loader": "7.1.0",
"vue-cli-plugin-vuetify": "^1.0.1",
"vue-template-compiler": "^2.6.10",
"vuetify-loader": "^1.2.2"
}
}