Summary
The published memfs tarball includes JavaScript sourcemaps that point at TypeScript sources which are not included in the package, and the maps do not embed sourcesContent. Tools that try to hydrate source content (for example Vite 8) warn when memfs is imported.
I confirmed this in memfs@4.57.1 and the current memfs@4.57.2 tarball.
Example
lib/index.js ends with:
//# sourceMappingURL=index.js.map
lib/index.js.map contains:
{
"sources": ["../src/index.ts"]
}
but the npm tarball has no src/index.ts, and the map has no sourcesContent array. The other published lib/**/*.js.map entry maps appear to follow the same pattern.
User-visible symptom
With Vite, importing memfs can emit:
Sourcemap for ".../node_modules/memfs/lib/index.js" points to missing source files
With DEBUG=vite:sourcemap, Vite shows the exact missing path:
Missing sources:
.../node_modules/memfs/src/index.ts
Possible fixes
Any of these would resolve it:
- Embed
sourcesContent in the published .js.map files.
- Publish the referenced
src/**/*.ts files.
- If source maps are not intended to be useful to consumers, omit the emitted source map comments/maps from the tarball.
Thanks!
Summary
The published
memfstarball includes JavaScript sourcemaps that point at TypeScript sources which are not included in the package, and the maps do not embedsourcesContent. Tools that try to hydrate source content (for example Vite 8) warn whenmemfsis imported.I confirmed this in
memfs@4.57.1and the currentmemfs@4.57.2tarball.Example
lib/index.jsends with://# sourceMappingURL=index.js.maplib/index.js.mapcontains:{ "sources": ["../src/index.ts"] }but the npm tarball has no
src/index.ts, and the map has nosourcesContentarray. The other publishedlib/**/*.js.mapentry maps appear to follow the same pattern.User-visible symptom
With Vite, importing
memfscan emit:With
DEBUG=vite:sourcemap, Vite shows the exact missing path:Possible fixes
Any of these would resolve it:
sourcesContentin the published.js.mapfiles.src/**/*.tsfiles.Thanks!