Getting statusCode":404,"error":"Not Found" on each static views.
See original GitHub issueTrying 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:
- Created 7 years ago
- Comments:5 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The correct path is then just
__dirname
. 😃 It’s wherever the prodindex.html
is. In that template, the sameindex.html
is used for both dev and prod and its in the root - same folder as the Webpack config.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?