amazon-kinesis-video-streams-webrtc-sdk-js icon indicating copy to clipboard operation
amazon-kinesis-video-streams-webrtc-sdk-js copied to clipboard

Sourcemap references src file not included in package

Open SijmenHuizenga opened this issue 1 year ago • 0 comments

In the distributed package, inside the source maps, there are references to typescript files in the src folder. Since the src folder is not distributed as part of the released package, source map parsing fails.

For example, this is a snippet from index.js.map version 2.0.2:

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

The file ../src/index.ts does not exist in the package.

I guess the solution would be to remove source maps from the package or add the src at the location the source maps pointing to.

As described in #172, when using create-react-app it results in the following errors:

WARNING in ../node_modules/amazon-kinesis-video-streams-webrtc/lib/Role.js
Module Warning (from ../node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '../node_modules/amazon-kinesis-video-streams-webrtc/src/Role.ts' file: Error: ENOENT: no such file or directory, open '..//node_modules/amazon-kinesis-video-streams-webrtc/src/Role.ts'
WARNING in ../node_modules/amazon-kinesis-video-streams-webrtc/lib/SigV4RequestSigner.js
Module Warning (from ../node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '..//node_modules/amazon-kinesis-video-streams-webrtc/src/SigV4RequestSigner.ts' file: Error: ENOENT: no such file or directory, open '..//node_modules/amazon-kinesis-video-streams-webrtc/src/SigV4RequestSigner.ts'
WARNING in ../node_modules/amazon-kinesis-video-streams-webrtc/lib/SignalingClient.js
Module Warning (from ../node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '../node_modules/amazon-kinesis-video-streams-webrtc/src/SignalingClient.ts' file: Error: ENOENT: no such file or directory, open '../node_modules/amazon-kinesis-video-streams-webrtc/src/SignalingClient.ts'
WARNING in ../node_modules/amazon-kinesis-video-streams-webrtc/lib/index.js
Module Warning (from ../node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '../node_modules/amazon-kinesis-video-streams-webrtc/src/index.ts' file: Error: ENOENT: no such file or directory, open '../node_modules/amazon-kinesis-video-streams-webrtc/src/index.ts'
WARNING in ../node_modules/amazon-kinesis-video-streams-webrtc/lib/internal/DateProvider.js
Module Warning (from ../node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '../node_modules/amazon-kinesis-video-streams-webrtc/src/internal/DateProvider.ts' file: Error: ENOENT: no such file or directory, open '../node_modules/amazon-kinesis-video-streams-webrtc/src/internal/DateProvider.ts'
WARNING in ../node_modules/amazon-kinesis-video-streams-webrtc/lib/internal/utils.js
Module Warning (from ../node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '../node_modules/amazon-kinesis-video-streams-webrtc/src/internal/utils.ts' file: Error: ENOENT: no such file or directory, open '../node_modules/amazon-kinesis-video-streams-webrtc/src/internal/utils.ts'

A workaround for hiding these errors when using cargo is described here.

SijmenHuizenga avatar Mar 07 '23 13:03 SijmenHuizenga