Ошибка компиляции Vuetify & Webpack Encore - PullRequest
0 голосов
/ 02 июля 2019

Я создал (в настоящее время автономный) и API, а также приложение VueJs (с Vuetify) и хотел объединить оба с помощью набора пакетов Webpack для Symfony.

Но когда я хочу создать приложение внешнего интерфейса, я получаю эту ошибку при выполнении yarn run encore dev:

(node:12500) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'length' of undefined
    at items.forEach.item (/Users/pguetschow/Projects/hosting-tool/node_modules/vuetify-loader/lib/loader.js:21:60)
    at Set.forEach (<anonymous>)
    at Object.getMatches (/Users/pguetschow/Projects/hosting-tool/node_modules/vuetify-loader/lib/loader.js:16:9)
    at Object.module.exports (/Users/pguetschow/Projects/hosting-tool/node_modules/vuetify-loader/lib/loader.js:106:64)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:12500) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:12500) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Это мой webpack.config.js

const Encore = require('@symfony/webpack-encore');
const VuetifyLoaderPlugin = require('vuetify-loader/lib/plugin');

Encore
    .setOutputPath('public/build/')
    .setPublicPath('/build')
    .cleanupOutputBeforeBuild()
    .enableSourceMaps(!Encore.isProduction())
    .cleanupOutputBeforeBuild()
    .addEntry('js/main', './assets/js/main.js')
    .enableVueLoader()
    .enableBuildNotifications(true)
    .addPlugin(new VuetifyLoaderPlugin())
;
module.exports = Encore.getWebpackConfig();

Есть идеи? Автономное приложение работает нормально, я просто переместил его в папку assets / js. Для этого мне нужен vuetify-loader ^ 1.2.2.

А это мой main.js:

import Vue from 'vue'
import App from './App.vue'
import Vuetify from 'vuetify/lib'
import MultiFiltersPlugin from './plugins/MultiFilters'

import 'vuetify/src/stylus/app.styl'
import 'material-design-icons-iconfont/dist/material-design-icons.css'
import 'vuetify/dist/vuetify.min.css'

Vue.use(MultiFiltersPlugin);
Vue.use(Vuetify, {
    iconfont: 'md',
});

new Vue({render: h => h(App),}).$mount('#app');
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...