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.

Issue with serving static file html with public dir after rc13

See original GitHub issue

Environment

  • Operating System: Darwin
  • Node Version: v18.12.1
  • Nuxt Version: 3.0.0-rc.13
  • Nitro Version: 0.6.1
  • Package Manager: pnpm@7.14.2
  • Builder: vite
  • User Config: extends, meta, runtimeConfig, modules, unocss, vueuse, ssr, pageTransition, vue, nitro, sourcemap, vite, build, typescript
  • Runtime Modules: @pinia/nuxt@0.4.3, @vueuse/nuxt@9.4.0, @unocss/nuxt@0.46.3
  • Build Modules: -

Reproduction

  1. Create stand alone html file with resources inside public/magic dir
  2. Use the created html file in i frame inside any component of page

Reproduction : https://stackblitz.com/edit/nuxt-starter-tf7qkb?file=pages/index.vue

Describe the bug

I am using trading view charting library which requires to put all the related file to public dir and serve them as it is and library uses relative path to get other assets.

This was working fine. But after updating to pnpm and rc13 it return 404

Additional context

Screenshot from private project Screenshot 2022-11-06 at 9 38 26 PM

Logs

No response

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
itsmnthncommented, Nov 8, 2022

I’ve got solution. this was problem of caching clearing browser cache worked. It is strange I did not configure anything to cache things.

Thanks for prompt replies.

1reaction
manniLcommented, Nov 6, 2022
  1. It seems that you have a typo (bundle/bundles) in your reproduction
  2. You need to use src instead of href

Fixed stackblitz

Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - express.static not serving .html file from public folder
The key issue is about conflict in the API call of GET / . There are two binding points, first, return 'Some Text',...
Read more >
Serving static files in Express
For example, use the following code to serve images, CSS files, and JavaScript files in a directory named public : app.use(express.static('public')).
Read more >
Generated static files html files have wrong assets paths #8158
I experienced a similar issue all of a sudden which I thought was extremely weird. After next export and uploading the out folder...
Read more >
Basic Features: Static File Serving - Next.js
Next.js can serve static files, like images, under a folder called public in the root directory. Files inside public can then be referenced...
Read more >
How to manage static files (e.g. images, JavaScript, CSS)
This page describes how you can serve these static files. ... Store your static files in a folder called static in your app....
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