You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Missing Source Map Files in @kubernetes/client-node@1.0.0 Cause ~100 Vite Warnings #2249
Missing Source Map Files in @kubernetes/client-node@1.0.0 Cause Vite Warnings
Description
The @kubernetes/client-node package (v1.0.0) includes source map comments (e.g., //# sourceMappingURL=StorageV1alpha1Api.js.map) in its generated JS files under dist/gen/apis/, but the .map files are not included in the npm package. This causes repeated "Failed to load source map" warnings in Vite (used by Nuxt 3) during development, cluttering logs and confusing developers. The warnings are cosmetic but degrade the dev experience due to a packaging issue.
import*ask8sfrom'@kubernetes/client-node';exportasyncfunctiontestK8s(){constkc=newk8s.KubeConfig();kc.loadFromCluster();constk8sApi=kc.makeApiClient(k8s.NetworkingV1Api);console.log('K8s API initialized');}
No source map warnings, either by including .map files or removing the comments.
Actual Behavior
~100 Warnings like:
[7:46:46 PM] WARN Failed to load source map for /node_modules/@kubernetes/client-node/dist/gen/apis/StorageV1alpha1Api.js.
Error: ENOENT: no such file or directory, open '/node_modules/@kubernetes/client-node/dist/gen/apis/StorageV1alpha1Api.js.map'
Examples
Affected files: StorageV1alpha1Api.js, CoreV1Api.js, util.js, etc.
Warning: See above log snippet.
Why It’s a Problem
Clutters dev logs, confuses developers, adds minor overhead.
Suggested Fix
Include .map files in the package, or
Remove //# sourceMappingURL=... comments during build (e.g., --sourceMap false).
changed the title [-]Missing Source Map Files in `@kubernetes/client-node@1.0.0` Cause Vite Warnings[/-][+]Missing Source Map Files in `@kubernetes/client-node@1.0.0` Cause ~100 Vite Warnings[/+]on Feb 22, 2025
I'm leaning toward removing the source maps. All of the transpiled files that I checked appear to be very readable and don't really benefit from having source maps. What do other folks think?
I'm not sure that we can do it without two separate build steps, but I'm also not 100% sure. I don't think it makes sense to disable them only for certain files though. Even though the generated code isn't meant to be read, you'd be stuck if you were trying to debug code that entered the generated code and that code happened to be unreadable.
@MichaelJCole I realize you mostly just want the Vite warnings to go away, but as a user, do you think having or not having the source maps would make any difference to you?
Hi, thanks for reading.
If there's a problem, I'll want a stack trace. If the code is transpiled (typescript->javascript) I'll want the stack trace in the source, not the transpired code.
How can users make issues/patches wo visibility in the source?
This module isn't for the browser, so size isn't a factor.
Why delete them at all? It just seems like extra work to mess up the tooling. But maybe I'm missing something.
Fwiw I decided to use caddy instead.
-------- Original Message --------
On Feb 22, 2025, 9:14 PM, Colin Ihrig wrote:
I'm not sure that we can do it without two separate build steps, but I'm also not 100% sure. I don't think it makes sense to disable them only for certain files though. Even though the generated code isn't meant to be read, you'd be stuck if you were trying to debug code that entered the generated code and that code happened to be unreadable.
***@***.***(https://github.com/MichaelJCole) I realize you mostly just want the Vite warnings to go away, but as a user, do you think having or not having the source maps would make any difference to you?
—
Reply to this email directly, [view it on GitHub](#2249 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AALPMFSNNRXZESKXC6CN2ND2RE4J5AVCNFSM6AAAAABXUOQIR6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNZWGUZTIMZTGE).
You are receiving this because you were mentioned.Message ID: ***@***.***>
[cjihrig]cjihrig left a comment [(kubernetes-client/javascript#2249)](#2249 (comment))
I'm not sure that we can do it without two separate build steps, but I'm also not 100% sure. I don't think it makes sense to disable them only for certain files though. Even though the generated code isn't meant to be read, you'd be stuck if you were trying to debug code that entered the generated code and that code happened to be unreadable.
***@***.***(https://github.com/MichaelJCole) I realize you mostly just want the Vite warnings to go away, but as a user, do you think having or not having the source maps would make any difference to you?
—
Reply to this email directly, [view it on GitHub](#2249 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AALPMFSNNRXZESKXC6CN2ND2RE4J5AVCNFSM6AAAAABXUOQIR6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNZWGUZTIMZTGE).
You are receiving this because you were mentioned.Message ID: ***@***.***>
Activity
[-]Missing Source Map Files in `@kubernetes/client-node@1.0.0` Cause Vite Warnings[/-][+]Missing Source Map Files in `@kubernetes/client-node@1.0.0` Cause ~100 Vite Warnings[/+]cjihrig commentedon Feb 22, 2025
I'm leaning toward removing the source maps. All of the transpiled files that I checked appear to be very readable and don't really benefit from having source maps. What do other folks think?
brendandburns commentedon Feb 22, 2025
We should definitely remove them for generated code. That's not meant to be read anyway.
Is there a way that we can exclude for generated code, but retain for hand-written code?
cjihrig commentedon Feb 23, 2025
I'm not sure that we can do it without two separate build steps, but I'm also not 100% sure. I don't think it makes sense to disable them only for certain files though. Even though the generated code isn't meant to be read, you'd be stuck if you were trying to debug code that entered the generated code and that code happened to be unreadable.
@MichaelJCole I realize you mostly just want the Vite warnings to go away, but as a user, do you think having or not having the source maps would make any difference to you?
MichaelJCole commentedon Feb 23, 2025
include source maps in npm pack
cjihrig commentedon Feb 23, 2025
Opened #2260 to include the source maps. You can test it by running
npm pack.