Closed tkoop closed 4 months ago
Why are you trying to import using the absolute path anyway?
NodeJS automatically resolves imports based on the package name using the best available location. You're probably breaking the logic by trying to force it to use a specific location.
What's wrong with:
import { createApp, h } from 'vue'
import { createInertiaApp } from '@inertiajs/vue3'
as used in every single project in existence?
Closing this one because we haven't heard anything back.
Version:
@inertiajs/vue3
version: 1.0.15Describe the problem:
In my main.js page, I have this line: import { createInertiaApp } from '/node_modules/@inertiajs/vue3'
But when it runs in a browser, the browser says: Uncaught SyntaxError: The requested module '/node_modules/deepmerge/dist/cjs.js?v=51e75926' does not provide an export named 'default'
Steps to reproduce:
Install Laravel and Vite and Inertia.
In index.blade.php: @vite('/resources/views/pages/main.js')
In that main.js file: import { createApp, h } from '/node_modules/vue' import { createInertiaApp } from '/node_modules/@inertiajs/vue3'
The "vue" file gets imported, but I can't import @inertiajs/vue3, becaues the browser throws that error.
I am not including deepmerge in my package.json, but package-lock.json mentions node_modules/deepmerge version 4.3.1