question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Favicon.ico seems to ignores app.cdnURL when set

See original GitHub issue

Environment

S3 buckets + cloudfront / AWS-lambda, build using Nuxt v3.0.0-rc.3

Reproduction

Use custom cdnURL for production:

export default defineNuxtConfig({
  nitro: {
    preset: 'aws-lambda'
  },
  app: {
    cdnURL: 'https://cdn.website.com/'
  }
})

Describe the bug

The client tries to load the favicon using the regular baseURL: https://lambda.website.com/favicon.ico

Instead of using the cdnURL: https://cdn.website.com/favicon.ico

Additional context

I serve my static public folder using S3 buckets / cloudfront and the server folder using AWS-lambda.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
DRoetcommented, Jul 1, 2022

@bros4president yeah I ended up writing a small plugin using useHead() + useRuntimeConfig():

// plugins/head.ts
export default defineNuxtPlugin(() => {
  const config = useRuntimeConfig()
  return useHead({
    link: [
      { rel: 'icon', type: 'image/x-icon', href: `${config.app.cdnURL}/favicon.ico` }
    ]
  })
})
0reactions
bros4presidentcommented, Jun 30, 2022

Hi @DRoet!

Did you manage to make this work?

I’m struggling right now with this issue since I have pages of the form pages/[foo].vue that cause problems when no favicon.ico is available at /favicon.ico. Nuxt’s router will try to render a page with [foo].vue, so I need to tell the browser where to request the icon.

Thanks in advance 😃!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to prevent favicon.ico requests? - Stack Overflow
ico. You can now simply right click the favicon.ico request and click "Block request URL". screenshot of blocking a specific request URL for...
Read more >
What is favicon.ico and why does my browser request ... - Cisco
Modern browsers will show an icon to the left of the URL. This known as the 'favicon.ico' and is typically fetched from website.com/favicon.ico....
Read more >
What Are Favicons: Everything You Need to Know in 2021
What Are Favicons: A Comprehensive Guide ... What is a favicon? It is the little icon that appear next to the webpage title...
Read more >
Adding a favicon — Flask Documentation (1.1.x)
A common question is how to add a favicon to a Flask application. First, of course, you need an icon. It should be...
Read more >
Create a Custom Favicon on your Experience Cloud Site or ...
Resources to be used as a favicon (favorite icon) has to be 16x16 in size and of .ico format. There are multiple ways...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found