Static GitHub Issues

[159] Nuxt Generate - Failed to load resource: The requested URL was not found on this server.

prev: request for built in analytics
next: Dynamic nested routes with parent url.

Hi there!

I just tried to generate a dist version and when I open the index.html, my console is logging this:

[Error] Failed to load resource: The requested URL was not found on this server. (file:///_nuxt/style.css, line 0)
[Error] Failed to load resource: The requested URL was not found on this server. (file:///_nuxt/logo-cdb-header.3a52180.png, line 0)
[Error] Failed to load resource: The requested URL was not found on this server. (file:///_nuxt/vendor.bundle.js, line 0)
[Error] Failed to load resource: The requested URL was not found on this server. (file:///_nuxt/nuxt.bundle.js, line 0)

I can confirm that the folder _nuxt and the files that failed to load are there. Here is the nuxt generate log:

[nuxt] Generating...
  nuxt:build App root: /Users/michaelamaral/dev/cdb +0ms
  nuxt:build Generating .nuxt/ files... +1ms
  nuxt:build Generating routes... +12ms
  nuxt:build Generating files... +31ms
  nuxt:build Building files... +19ms
[nuxt:build:client]
 Hash: 57b7e5f7120bc082bcd8
Version: webpack 2.2.0-rc.6
Time: 22863ms
                           Asset       Size  Chunks                    Chunk Names
                1.nuxt.bundle.js    23.5 kB       1  [emitted]         
 fonts/element-icons.a61be9c.eot    13.5 kB          [emitted]         
fonts/element-icons.d2f69a9.woff       8 kB          [emitted]         
   img/element-icons.09162bc.svg    17.4 kB          [emitted]         
            img/logo.ddcb767.png    6.54 kB          [emitted]         
 img/logo-cdb-header.3a52180.png    11.3 kB          [emitted]         
                0.nuxt.bundle.js    1.96 kB       0  [emitted]         
 fonts/element-icons.b02bdc1.ttf    13.2 kB          [emitted]         
                2.nuxt.bundle.js  817 bytes       2  [emitted]         
                3.nuxt.bundle.js    1.02 kB       3  [emitted]         
                4.nuxt.bundle.js  658 bytes       4  [emitted]         
                  nuxt.bundle.js    41.1 kB       5  [emitted]         app
                vendor.bundle.js     514 kB       6  [emitted]  [big]  vendor
                       style.css     114 kB       5  [emitted]         app
                   style.css.map   86 bytes       5  [emitted]         app

WARNING in asset size limit: The following asset(s) exceed the recommended size limit (250 kB).
This can impact web performance.
Assets: 
  vendor.bundle.js (514 kB)

WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (250 kB). This can impact web performance.
Entrypoints:
  vendor (514 kB)
      vendor.bundle.js
,
  app (669 kB)
      vendor.bundle.js
,      nuxt.bundle.js
,      style.css

Child extract-text-webpack-plugin:
                               Asset     Size  Chunks             Chunk Names
     fonts/element-icons.a61be9c.eot  13.5 kB          [emitted]  
     fonts/element-icons.b02bdc1.ttf  13.2 kB          [emitted]  
    fonts/element-icons.d2f69a9.woff     8 kB          [emitted]  
       img/element-icons.09162bc.svg  17.4 kB          [emitted]  
[nuxt:build:server]
 Hash: aac67c4ffffcf7da7db2
Version: webpack 2.2.0-rc.6
Time: 22835ms
                          Asset     Size  Chunks             Chunk Names
           img/logo.ddcb767.png  6.54 kB          [emitted]  
img/logo-cdb-header.3a52180.png  11.3 kB          [emitted]  
               server-bundle.js   160 kB       0  [emitted]  main
  nuxt:generate Destination folder cleaned +23s
  nuxt:generate Static & build files copied +228ms
  nuxt:render Rendering url /about +2ms
  nuxt:render Rendering url /empresas +228ms
  nuxt:render Rendering url / +8ms
  nuxt:render Rendering url /nova +10ms
created
undefined
  nuxt:generate Generate file: /about/index.html +306ms
  nuxt:generate Generate file: /empresas/index.html +32ms
  nuxt:generate Generate file: /index.html +76ms
  nuxt:generate Generate file: /nova/index.html +23ms
(node:3368) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 4): ReferenceError: XMLHttpRequest is not defined
(node:3368) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
  nuxt:generate HTML Files generated in 24s +4ms
[nuxt] Generate done

Also, I've noticed the warning about the size, and I'm not sure why it is so big. My project just have 3 pages, and doesn't have that much dependencies, despite having a lot of images in static. Does that count..?

Thanks

Edit:

Btw, maybe this can be helpful:

build: {
    vendor: [
      'axios'
    ]
  },
  plugins: [
    '~plugins/uikit',
    '~plugins/cordova'
  ]
}
<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c132">#c132</a>)</em></sub></div>