awslabs / amazon-kinesis-video-streams-webrtc-sdk-js

JS SDK for interfacing with the Amazon Kinesis Video Streams Signaling Service.
https://awslabs.github.io/amazon-kinesis-video-streams-webrtc-sdk-js/examples/index.html
Apache License 2.0
286 stars 141 forks source link

Sourcemap references src file not included in package #219

Closed SijmenHuizenga closed 3 weeks ago

SijmenHuizenga commented 1 year ago

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.

niyatim23 commented 3 weeks ago

Hi @SijmenHuizenga, please refer to the React application here and see if it resolves the problems for you. Feel free to reopen the issue if it doesn't