0

could anyone explain to me what could go wrong here?

I've deployed a blog application written in Nuxt.js with dynamic article pages to now.sh - . Nothing fancy there. The home page works fine. When I'm visiting sub-pages using internal links, also everything is fine.

However, when I do a hard-refresh on the sub-pages, I'm getting an error: Nuxt.js Internal Server Error

I've checked the logs and this is what I get:

Duration: 27.23 ms  Billed Duration: 100 ms  Memory Size: 3008 MB  Max Memory Used: 120 MB    
Duration: 24.45 ms  Billed Duration: 100 ms  Memory Size: 3008 MB  Max Memory Used: 121 MB    
 ERROR  Request failed with status code 500
  at e.exports (server.js:2:18485)
  at e.exports (server.js:2:45908)
  at IncomingMessage.<anonymous> (server.js:2:354490)
  at IncomingMessage.emit (events.js:203:15)
  at IncomingMessage.EventEmitter.emit (domain.js:448:20)
  at endReadableNT (_stream_readable.js:1143:12)
  at process._tickCallback (internal/process/next_tick.js:63:19)
Duration: 669.35 ms  Billed Duration: 700 ms  Memory Size: 3008 MB  Max Memory Used: 126 MB

It's a super-simple nuxt application, I'm really not sure how anything could be wrong here.

Repository: https://github.com/driggl/blog

Seb Wilgosz
  • 1,240
  • 15
  • 24

1 Answers1

2

I think that is not a problem with zeit. First you should configure how nuxt should generate your dynamic routes.

Check this fragment of the documentation: https://nuxtjs.org/api/configuration-generate/#routes

And you have some information on Stack also, here => Nuxt Generate Dynamic Routes Path

Szymon
  • 170
  • 9
  • You're right, it doesnt seem like a problem with zeit , but rather problem with application itself. However, I've never experienced that issue on other hosting providers. I have found the application crashes when I am trying to fetch data from API. The API worjs well though, not sure why it crashes then:( – Seb Wilgosz Nov 17 '19 at 07:27
  • If you're using generate option, the API call is made in generate process (when nuxt creates static files). And when you will go to zeit link, whole API call are already made. You don't fetch data from API then, just the static file from the server. If 'nuxt' don't know what dynamic routes exactly are, then you will have that issue (also on netlify). You need to specify that in `nuxt.config.js` (like on link i shared above). You can look how it works there => https://nuxtjs.org/guide – Szymon Nov 17 '19 at 07:56