Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding NuxtUI for Vue3 plugin to Vite config cause an error #43

Open
kamilcglr opened this issue Nov 6, 2024 · 0 comments
Open

Adding NuxtUI for Vue3 plugin to Vite config cause an error #43

kamilcglr opened this issue Nov 6, 2024 · 0 comments

Comments

@kamilcglr
Copy link

kamilcglr commented Nov 6, 2024

Package version

1.2.3

Context

Hello, a few weeks ago, the Nuxt team made the Nuxt UI v3 component library compatible with standalone Vue projects.

I've been looking for a solution to use it with Inertia and AdonisJS, but I get an unexpected error:

TypeError: The URL must be of scheme file

Describe the bug

Here's the procedure I followed:

After creating a fresh AdonisJS project with the Inertia and Vue 3 starter kit

# Vue without server-side rendering
npm init adonisjs@latest -- -K=inertia --adapter=vue --no-ssr

Then I followed this procedure to add NuxtUI to the project

  1. Install the package with the latest commit, as the release has not yet been made
npm install https://pkg.pr.new/@nuxt/ui@5a9511f
  1. Add the Nuxt UI Vite plugin in the vite.config.ts
import ui from '@nuxt/ui/vite'
import { defineConfig } from 'vite'
import { getDirname } from '@adonisjs/core/helpers'
import inertia from '@adonisjs/inertia/client'
import vue from '@vitejs/plugin-vue'
import adonisjs from '@adonisjs/vite/client'

export default defineConfig({
  plugins: [
    inertia({ ssr: { enabled: false } }),
    vue(),
    adonisjs({ entrypoints: ['inertia/app/app.ts'], reload: ['resources/views/**/*.edge'] }),
    ui(),
  ],

  resolve: {
    alias: {
      '~/': `${getDirname(import.meta.url)}/inertia/`,
    },
  },
})

Here I already have a problem: I can't launch the application.

failed to load config from /Users/kamil/Documents/projects/myproject/vite.config.ts
TypeError: The URL must be of scheme file

Here is the Replit to reproduce
https://replit.com/@kamilcaglarcont/Adonis-x-Inertia-x-Vue-3-x-Nuxt-UI?v=1

Additional context

  • I tried with node 18, 20 and 22.
  • There is no problem with the use of the library with a Vite et Vue project alone.
  • It seems to be a problem with Vite or AdonisJS, but the error is not very explicit.

Logs

[ info ] starting HTTP server...
Debugger attached.
failed to load config from /Users/kamil/Documents/projects/myproject/vite.config.ts

   TypeError: The URL must be of scheme file

No more logs even with DEBUG=vite:*

Reproduction repo

https://replit.com/@kamilcaglarcont/Adonis-x-Inertia-x-Vue-3-x-Nuxt-UI?v=1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant