The source map comments included in the npm package point to source files that don't exist in the package. For example, build/module/index.js has the following contents:
import Plausible from './lib/tracker';
export default Plausible;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxTQUFTLE1BQU0sZUFBZSxDQUFDO0FBSXRDLGVBQWUsU0FBUyxDQUFDIn0=
which indicates that the original TypeScript source can be found at ../../src/index.ts. But the src/ directory doesn't exist at all in the package! This causes a warning from source-map-loader when run from a downstream packages and makes this code harder to debug.
Expected behavior
The source maps should be well-formed: either they should refer to files that exist or they should embed the TypeScript source directly using a "sourcesContent" key.
Steps to reproduce
Add plausible-tracker 0.3.4 as a dependency to a project that runs source-map-loader as part of its build.
Build that project.
Observe three warnings like the following are printed.
WARNING in ./node_modules/plausible-tracker/build/module/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '.../node_modules/plausible-tracker/src/index.ts' file: Error: ENOENT: no such file or directory, open '.../node_modules/plausible-tracker/src/index.ts'
@ ./src/analytics/plausible.ts 3:0-42 11:29-38
@ ./src/index.tsx 8:0-55 13:0-14
Versions
Describe the bug
The source map comments included in the npm package point to source files that don't exist in the package. For example,
build/module/index.js
has the following contents:sourceMappingURL
decodes to this JSON:which indicates that the original TypeScript source can be found at
../../src/index.ts
. But thesrc/
directory doesn't exist at all in the package! This causes a warning from source-map-loader when run from a downstream packages and makes this code harder to debug.Expected behavior
The source maps should be well-formed: either they should refer to files that exist or they should embed the TypeScript source directly using a
"sourcesContent"
key.Steps to reproduce