Menu

Our production JavaScript ships no source maps, so I identified 1.2 MB of it by its copyright strings
📰

Our production JavaScript ships no source maps, so I identified 1.2 MB of it by its copyright strings

DEV Community: nextjs·Daniel Pertu·13 days ago
#i4zAc5ec
#devtonextjs#devto#dev#bytes#react
Reading 0:00
15s threshold

Our FAQ page is static prose. One heading, a definition list of questions and answers, a header, a footer, and a 606 byte logo. Its HTML is 12,550 bytes over the wire.

It also references 19 JavaScript files totalling 1,237,376 bytes uncompressed. We wanted an inventory of what those actually are, and there are no source maps to ask.

Step one: confirm there is nothing to ask

$ for u in $( the 19 chunk URLs ) ; do curl -s -o /dev/null -w '%{http_code}\n' "https://pub-trivia.app $u .map" done 403 403 403 ... 19 times

Enter fullscreen mode

Exit fullscreen mode

And zero of the 19 files contains a sourceMappingURL comment. productionBrowserSourceMaps is not set in next.config.mjs , so none are emitted for the browser, which is the default and a reasonable one.

The 403 is worth a note of its own. A missing file under /_next/static/ on Vercel answers 403, not 404, so "no source map" and "wrong URL" are indistinguishable from the outside.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.