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.

Getting statusCode":404,"error":"Not Found" on each static views.

See original GitHub issue

Trying to use prerender-spa-plugin, but getting this on all generated views:

<html><head></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">{"statusCode":404,"error":"Not Found"}</pre></body></html>

I use vue 2.x and vue-router 2.x. Here’s my config:

plugins: [
    new PrerenderSpaPlugin(
        path.join(__dirname, '/static'),
        [ '/fr/', '/en/', '/fr/contact/', '/en/contact/', '/test' ]
    )
]

Here’s my root Vue instance:

new Vue({
    el: '#app',
    router,
    store,
    render: h => h(App)
})

App.vue:

<template>
    <div id="app">
        <!-- Route Outlet -->
        <router-view></router-view>
    </div>
</template>

<script>
export default {

}
</script>

What would be a possible solution to this issue?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
chrisvfritzcommented, Oct 15, 2016

The correct path is then just __dirname. 😃 It’s wherever the prod index.html is. In that template, the same index.html is used for both dev and prod and its in the root - same folder as the Webpack config.

0reactions
iMomencommented, Dec 26, 2017

I still have some confusion about this this is my config in webpack.prod.conf

new PrerenderSpaPlugin( // Path to compiled app path.join(__dirname, '../dist'), // List of endpoints you wish to prerender [ '/', '/privacy','/contact'] )

But the rendered files are still empty 😦 any hint?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix Error 404 Not Found on Your WordPress Site - Kinsta
The Error 404 Not Found status code indicates that the origin server did not find the target resource. Check out these common causes...
Read more >
Error 404 not found - What does it mean & how to fix it! - IONOS
Something along the lines of '404 Not Found'. A 404 error is the standardized HTTP status code. The message is sent from the...
Read more >
Error 404: 4 Ways to Fix It - Hostinger
Error 404 is a response code, meaning the server could not locate the requested content. Check this article to learn 4 steps to...
Read more >
How can I properly handle 404 in ASP.NET MVC?
I want all my 404s to return an MVC view (not a static page) to which i can pump more data later if...
Read more >
HTTP 404 - Wikipedia
In computer network communications, the HTTP 404, 404 not found, 404, 404 error, page not found or file not found error message is...
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