Nuxt.js: NuxtserverInit and Middleware are being hit on *.css.map requests

Created on 30 Sep 2018  路  8Comments  路  Source: nuxt/nuxt.js

Version

v2.0.0

Steps to reproduce

I noticed that NuxtserverInit and Middleware are being called on every *.css.map request.

Probably, to reprouduce one needs to set extractCSS: true,

What is expected ?

NuxtserverInit should only be called on pages

What is actually happening?

*.css.map requests should not hit middleware

Additional comments?

This is causing a serious performance hit

This bug report is available on Nuxt community (#c7871)
available soon bug-report

Most helpful comment

Actually, it is a known issue. We are working on serve-placeholder to resolve this exact issue. Thanks for the report. Will open PR soon. Expect it for 2.2.0 :)

All 8 comments

Does it happen on production builds or only when run as dev?

Actually, it is a known issue. We are working on serve-placeholder to resolve this exact issue. Thanks for the report. Will open PR soon. Expect it for 2.2.0 :)

2.2.0 is out and I still have this issue in. For all *.map files. Any updates on this?

@swunderlich It's still in progress.

Any updates here?
I'm stuck with this issue.
image

Are you sure the map file exists? I found in Chrome it will have a guess as to where the map files are. If the map file is not found, it will generate a 404 instead which the Nuxt server will serve as a normal page, going though the whole NuxtServerInit/middleware for the 404 page. If a 404 is encountered, then the request will not be shown in the Chrome dev tools, only successful .map requests are shown there. Once I have understood this, it all feels like completely normal behaviour.

To test this, log out the context.route.path of the phantom requests. When the dev tools is open, I get an extra request for path: '/_nuxt/rocketship_vue.common.js.map'

Related to #1863. Working on a fix to prevent SSR renders for 404 hits inside _nuxt. Actually, serve-placeholder implemented a long time ago, it should be only integrated.

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mikekidder picture mikekidder  路  3Comments

vadimsg picture vadimsg  路  3Comments

jaredreich picture jaredreich  路  3Comments

uptownhr picture uptownhr  路  3Comments

danieloprado picture danieloprado  路  3Comments