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 nuxi generate

See original GitHub issue

Hello, first of all, thank you for this module ! I would like to use it with static generation and this does not seem to work.

In your repo, when I run pnpm nuxi generate example, I get the following error :

ℹ Prerendering 1 initial routes with crawler
  ├─ / (43ms)
  ├─ /manifest.f92523ca.json (undefinedms) (Error: EEXIST: file already exists, mkdir '/path/to/nuxt-pwa-module/example/.output/public/manifest.f92523ca.json')  

The build output seems to be fine. However, when I move the app.vue file into a pages folder and rename it to index.vue (closer to a real world configuration), with the same command I get this error :

ℹ Prerendering 1 initial routes with crawler
  ├─ / (48ms)
  ├─ /manifest.f92523ca.json (4ms) (Error: [404] Page not found: /manifest.f92523ca.json)  

In this case, the content of the manifest file is corrupted, so the app is not installable. Maybe the manifest file should be moved into the assets folder ? or ignored during the prerendering somehow ?

I am OK to contribute if it helps you and if you give me some indications 😃

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:14 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
kevinmarreccommented, May 31, 2022

This is just about Nitro trying to crawl a file as a route, I’d say.

The manifest link is grabbed from HTML : https://github.com/unjs/nitro/blob/main/src/prerender.ts#L112

Then it is not ignored cause json has been tagged as allowed extension : https://github.com/unjs/nitro/blob/main/src/prerender.ts#L10 https://github.com/unjs/nitro/blob/main/src/prerender.ts#L122

Let’s wait for some @pi0 thoughts about this.

1reaction
kevinmarreccommented, Jul 22, 2022

Should be fixed by https://github.com/kevinmarrec/nuxt-pwa-module/commit/fa800723f86de346343a4ea434346d79beda6989. I’ve tested to local serve a generated Nuxt 3 PWA app (with nuxi generate) and it sounds to work well.

Will be available in next release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fails immedeately when `nuxt generate --fail-on-error ... - GitHub
A problem I've found for now is the condition between failOnFirstError config option and --fail-on-error CLI option. I have 3 ideas: existing -- ......
Read more >
Issues when generating NUXT build - Stack Overflow
Save this question. Show activity on this post. I am building a nuxt ssr app and whenever I run build command, I get...
Read more >
The generate Property - Nuxt
It accepts an array of string or regular expressions and will prevent generation of routes matching them. The routes will still be accessible...
Read more >
Nuxt Static Improvements - NuxtJS
... the rendering and build process. The only issue was that most Nuxt.js users weren't able to unleash the full potential of the...
Read more >
Some Problems I Had in Nuxt JS (and how to solve them)
Each folder created in the store folder will create a new module for the store. However, as long as we are coding or...
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