Module build failed (from ./node_modules/sass-loader/dist/cjs.js)


安裝 Vuetify 筆記

安裝

使用 Laravel Mix Extension

步驟

1.npm install

npm i vuetifyjs-mix-extension -D

2.Then require the extension in your Mix configuration:

const mix = require('laravel-mix')

require('vuetifyjs-mix-extension') //require this

3.Enable the extension by calling vuetify() in your Mix chain:

mix.js('resources/js/app.js', 'public/js').vuetify()
//if you use vuetify-loader
mix.js('resources/js/app.js', 'public/js').vuetify('vuetify-loader')

4.Run npm script

npm run dev

問題

遇到 Module build failed (from ./node_modules/sass-loader/dist/cjs.js)
原因是 sass loader 版本過高(8.0.0)。

搞好久差點放棄,看錯誤代碼的功力太差= =

錯誤訊息:

Module build failed (from ./node_modules/sass-loader/dist/cjs.js): ValidationError: Invalid options object. Sass Loader has been initialized using an

解決

重裝 sass-loader@7.1.0

npm uninstall --save-dev sass-loader
npm install --save-dev sass-loader@7.1.0
隨筆






Related Posts

Google Cloud Source Repositories 使用紀錄

Google Cloud Source Repositories 使用紀錄

進階 React Component Patterns 筆記(上)

進階 React Component Patterns 筆記(上)

MTR04_0824

MTR04_0824



Comments











Sponsored