launchdarkly / js-sdk-common

Code shared between all LaunchDarkly client-side JS-based SDKs
Other
3 stars 26 forks source link

Source maps reference files not published to NPM #109

Open vdh opened 3 weeks ago

vdh commented 3 weeks ago

Is this a support request? No

Describe the bug The source maps reference files that get excluded from the distributions published to NPM, causing source mapping errors

e.g. in index.js.map

{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"]…

The entire src folder is not included

To reproduce Try to debug SDK calls in VSCode

Expected behavior Either the source maps should not reference missing files, or the source files should be published to NPM

Logs

Could not load source '(local path omitted)/node_modules/@launchdarkly/js-server-sdk-common/src/LDClientImpl.ts': Unable to retrieve source content.

SDK version @launchdarkly/node-server-sdk@npm:^9.5.0, @launchdarkly/js-sdk-common@npm:2.5.0, @launchdarkly/js-server-sdk-common@npm:2.4.4

Language version, developer tools Node v18.13.0, VSCode 1.92.2

OS/platform macOS 14.6.1 (23G93)

kinyoklion commented 3 weeks ago

Hello @vdh,

I think you are in the wrong repository. This is for the common library used by client-side JavaScript SDKs. It is written in JavaScript and not minified, so it has no source maps.

The repository containing all the references projects is here: https://github.com/launchdarkly/js-core

In that case the source is not included in the package, but you can download it from the respository for the tags that you want to debug.

"Either the source maps should not reference missing files, or the source files should be published to NPM"

I think more likely we would not include source maps. These packages are not minified (though they are written in typescript), so the JS is directly readable.

Thanks, Ryan