svitejs / vite-plugin-qrcode

Show QR code on server start
MIT License
147 stars 3 forks source link

Doesn't work in nuxt 3 #73

Closed marssantoso closed 1 year ago

marssantoso commented 1 year ago

Describe the bug

Hi. First of all, nice plugin that could potentially speed up our workflow. Anyway, I tried using this plugin with the latest stable version of Nuxt 3 to no avail. My config attached below.

Tbh, not sure if it's a bug or if it's never intended to work with nuxt in the first place. Looking forward to be able to use this plugin, though.

Cheers.

Reproduction

Here is my nuxt.config

import { qrcode } from 'vite-plugin-qrcode'

export default defineNuxtConfig({
  // ...
  vite: {
    plugins: [qrcode()],
  },
  // ...
})

Logs

No response

System Info

System:
    OS: macOS 13.0
    CPU: (8) arm64 Apple M1
    Memory: 85.88 MB / 8.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.13.0 - ~/.nvm/versions/node/v16.13.0/bin/node
    Yarn: 1.22.11 - ~/.npm/global/bin/yarn
    npm: 8.1.0 - ~/.nvm/versions/node/v16.13.0/bin/npm
  Browsers:
    Chrome: 107.0.5304.110
    Firefox Developer Edition: 101.0
    Safari: 16.1

Severity

annoyance

bluwy commented 1 year ago

Nuxt seems to be using it's own server, so the plugin doesn't know what the server URLs are and when to log them, so I think it's out of scope to support Nuxt for now. I'm not sure if Nuxt has an API to extend the CLI output, but it would have to use that to log the qrcode. Closing this one for now.