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.

Content is not loaded after generate

See original GitHub issue

Environment


  • Operating System: Linux
  • Node Version: v16.15.0
  • Nuxt Version: 3.0.0-rc.4
  • Package Manager: npm@8.5.5
  • Builder: vite
  • User Config: css, build, typescript, modules, components
  • Runtime Modules: @nuxt/content@2.0.1, unplugin-icons/nuxt
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/github-jdzmbl?file=components/Feed.vue

  1. Open stackblitz
  2. There are generated .output by npm run generate. I don’t know how to execute the generation command in stackblits, so I generated the files locally and put them in the project. You should get the same result by regenerating.
  3. Run npm run preview
  4. On / path you should see valid JSON array with content. But on subpath you should see HTML instead JSON

Describe the bug

I have several pages to display the content. In the desktop, the filtered JSON is displayed correctly on each page. However, after generating the site, HTML is returned instead of JSON

Additional context

No response

Logs

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:16 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
farnabazcommented, Jul 6, 2022

Try serving generated files using npx serve ./output/public.

Seems that serving with yarn nuxi preview cause this issue.

@danielroe Do you know what could have caused this issue?

1reaction
danielroecommented, Jul 5, 2022

The -s enables fallback to index.html if it doesn’t find an exact match. Maybe there is a bug in serve with query parameters?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Make loader gone after content is loaded - Stack Overflow
What i'm trying to accomplish is whenever the contents inside the tab is fully loaded my loader animation will disappear i tried adding...
Read more >
7 Ways to Fix Google Chrome Not Loading Images - MakeUseOf
The easiest fix is to rename the current data folder so that Chrome will create a new one. If you're using Windows 10,...
Read more >
Fix Lazy-Loaded Website Content | Google Search Central
Deferring loading of non-critical or non-visible content, also commonly known as "lazy loading", is a common performance and UX best practice.
Read more >
If Safari on Mac doesn't open a webpage or isn't working as ...
Check Safari settings. The webpage might not be compatible with one or more browser settings, which you can turn on or off as...
Read more >
Error 404 not found - What does it mean & how to fix it! - IONOS
Reload the page: It might be that the error 404 has appeared for the simple reason that the page did not load properly....
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