eidellev / inertiajs-adonisjs

280 stars 17 forks source link

Critical dependency: Accessing import.meta directly is unsupported (only property access is supported) #102

Closed marcelodelta closed 1 year ago

marcelodelta commented 1 year ago

On a clean install using step by step this error occurs when running dev mode.

When do you use vite

import { createApp, h } from 'vue' import { createInertiaApp } from '@inertiajs/vue3'

createInertiaApp({ resolve: name => { const pages = import.meta.glob('./Pages/*/.vue', { eager: true }) return pages[./Pages/${name}.vue] }, setup({ el, App, props, plugin }) { createApp({ render: () => h(App, props) }) .use(plugin) .mount(el) }, })

[ encore ] WARN Compiled with 1 warnings00:11:56 [ encore ] warn in ./resources/js/app.js00:11:56 [ encore ] Critical dependency: Accessing import.meta directly is unsupported (only property access is supported) [ encore ] WARNING in ./resources/js/app.js 6:16-27 Critical dependency: Accessing import.meta directly is unsupported (only property access is supported)

eidellev commented 1 year ago

Hey @marcelodelta This should work in Vite according to the docs, but it seems that the actual error is thrown by webpack-encore .

I would try to understand why encore is being used if you set up Vite.

At any rate, this is beyond the scope of this library.