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

Icon HTML not being injected into Nuxt project #87

Open
8 of 9 tasks
gridsystem opened this issue Jan 9, 2025 · 0 comments
Open
8 of 9 tasks

Icon HTML not being injected into Nuxt project #87

gridsystem opened this issue Jan 9, 2025 · 0 comments
Labels
c: bug Something isn't working s: pending triage Pending Triage

Comments

@gridsystem
Copy link

gridsystem commented Jan 9, 2025

Pre-Checks

Describe the bug

Hi! It's me again - I logged some Nuxt issues a while ago. I want to say thank you for looking at those notes and making changes to your project!

I really like what you're making. I've been looking forward to trying it again and I'm working on another Nuxt build over the next couple of weeks.

I've found couple more issues which I think might be related to each other.

  1. pnpm add @anolilab/unplugin-favicons with project using Nuxt 3.15.0 results in this messge
WARN Issues with peer dependencies found
@anolilab/unplugin-favicons 1.0.5
├── ✕ unmet peer rollup@^3: found 4.29.1
└── ✕ unmet peer vite@"^3 || ^4 || ^5": found 6.0.6
  1. Using this config, icons files are generated, but not injected into the HTML head.
export default defineNuxtConfig({
  compatibilityDate: '2024-11-01',
  devtools: {
    enabled: true
  },
  modules: [
    '@anolilab/unplugin-favicons/nuxt',
  ],
  unpluginFavicons: {
    logo: "./assets/browserIcons/icon.svg",
      favicons: {
      appName: "redacted",
      developerName: "redacted",
      developerURL: "redacted",
      background: "#bada55",
      theme_color: "#c0ff33",
      icons: {
        windows: false,
        yandex: false,
      }
    }
  }
}

After running nuxt generate to bundle a static site, I can see the generated files in ./nuxt/dist/client, but not in ./output/public. You can test this with a package.json similar to below.

"scripts": {
  "generate": "nuxt generate",
  "preview:production": "pnpm generate && pnpm serve .output/public",
},
"devDependencies": {
  "serve": "^14.2.4",
}

Then run pnpm preview:production

  1. The link to the Nuxt 3 example in your Readme is wrong
# Incorrect
https://github.com/anolilab/unplugin-favicons/blob/main/examples/nuxt
# Correct
https://github.com/anolilab/unplugin-favicons/tree/main/examples/nuxt3
  1. Following up from the last issue I made a while ago, it would be cool to add your configKey to the documentation the same way other module authors do. I had to poke around in the code to find the right property so that I could use the alternative (but still common) way of structuring the nuxt config.

Something like

You can customize the module's behavior by using the unpluginFavicons property in nuxt.config

Minimal reproduction code

No response

Additional Context

No response

Environment Info

System:
    OS: macOS 15.2
    CPU: (6) x64 Intel(R) Core(TM) i5-8500 CPU @ 3.00GHz
    Memory: 756.31 MB / 32.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 22.12.0 - ~/.nvm/versions/node/v22.12.0/bin/node
    npm: 11.0.0 - ~/.nvm/versions/node/v22.12.0/bin/npm
    pnpm: 9.15.2 - ~/.nvm/versions/node/v22.12.0/bin/pnpm
    Watchman: 2024.06.17.00 - /usr/local/bin/watchman
  Browsers:
    Chrome: 131.0.6778.206
    Safari: 18.2
  npmPackages:
    @anolilab/unplugin-favicons: ^1.0.5 => 1.0.5

Which module system do you use?

  • CJS
  • ESM

Used Package Manager

pnpm

@gridsystem gridsystem added c: bug Something isn't working s: pending triage Pending Triage labels Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: bug Something isn't working s: pending triage Pending Triage
Projects
None yet
Development

No branches or pull requests

1 participant