vuetifyjs / vuetify

🐉 Vue Component Framework
https://vuetifyjs.com
MIT License
39.67k stars 6.95k forks source link

[Bug Report][3.0.0-alpha.11] import { createVuetify } from 'vuetify' is Error #14124

Closed fumifumitaro closed 3 years ago

fumifumitaro commented 3 years ago

Environment

Vuetify Version: 3.0.0-alpha.11 Vue Version: 3.2.8 Browsers: Chrome 93.0.4577.63 OS: Windows

Steps to reproduce

npm install npm run dev

Expected Behavior

compile success

Actual Behavior

ERROR in ./node_modules/vuetify/lib/util/globals.mjs 1:30-37 Module not found: Error: Can't resolve 'process/browser'

Reproduction Link

https://github.com/fumifumitaro/meal_planning_suggest/tree/feature/create_basic_info_form

packaege.json

{
  "private": true,
  "scripts": {
    "dev": "npm run development",
    "development": "mix",
    "hot": "mix watch --hot",
    "prod": "npm run production",
    "production": "mix --production",
    "watch": "mix watch",
    "watch-poll": "mix watch -- --watch-options-poll=1000"
  },
  "dependencies": {
    "@mdi/font": "5.9.55",
    "roboto-fontface": "*",
    "vuetify": "^3.0.0-alpha.11"
  },
  "devDependencies": {
    "@inertiajs/inertia": "^0.9.4",
    "@inertiajs/inertia-vue3": "^0.4.2",
    "@inertiajs/progress": "^0.2.6",
    "@tailwindcss/forms": "^0.2.1",
    "@tailwindcss/typography": "^0.3.0",
    "@vue/compiler-sfc": "^3.2.8",
    "axios": "^0.21",
    "laravel-mix": "^6.0.29",
    "lodash": "^4.17.19",
    "postcss": "^8.3.6",
    "postcss-import": "^12.0.1",
    "sass": "~1.32.0",
    "sass-loader": "^10.0.0",
    "tailwindcss": "^2.2.9",
    "vue": "^3.2.8",
    "vue-cli-plugin-vuetify": "~2.4.2",
    "vue-loader": "^16.5.0",
    "vuetifyjs-mix-extension": "0.0.20"
  }
}

app.js

require('./bootstrap');

// Import modules...
import { createApp, h } from 'vue';
import { App as InertiaApp, plugin as InertiaPlugin } from '@inertiajs/inertia-vue3';
import { InertiaProgress } from '@inertiajs/progress';
import { createVuetify } from 'vuetify';

const el = document.getElementById('app');

createApp({
    render: () =>
        h(InertiaApp, {
            initialPage: JSON.parse(el.dataset.page),
            resolveComponent: (name) => require(`./Pages/${name}`).default,
        }),
})
    .mixin({ methods: { route } })
    .use(InertiaPlugin)
    .mount(el);

InertiaProgress.init({ color: '#4B5563' });

when remove import vuetify line, this project success compiling

KaelWD commented 3 years ago

https://github.com/laravel-mix/laravel-mix/issues/2737

fumifumitaro commented 3 years ago

Thanks!!

I appended below sentences to webpack.mix.js.

mix.options({
    legacyNodePolyfills: false
});

It works!