webcomponents / webcomponents/polyfills

[scoped-custom-element-registry] : Issue with sourcemaps

Open
#516 4 comments 1 reaction 0 assignees View on GitHub
Focus Area: Standards & Polyfills Type: Bug
Dominant language
HTML
Stars
1.2k
Forks
168
PR merge metrics
No merged PRs in 30d

Description

### Description
In a stock, non-ejected, `create-react-app` scaffolded application, using the `@webcomponents/scoped-custom-element-registry` polyfill package results in sourcemap warnings during the build step potentially caused by the sourcemaps being malformed?

### Example

The warning produce is similar to:

```
WARNING in ./node_modules/@webcomponents/scoped-custom-element-registry/scoped-custom-element-registry.min.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from 'C:\\node_modules\@webcomponents\scoped-custom-element-registry\scoped-custom-element-registry.min.js.map' file: Error: ENOENT: no such file or directory, open 'C:\\node_modules\@webcomponents\scoped-custom-element-registry\scoped-custom-element-registry.min.js.map'
```

The beginning of the generated sourcemap for the polyfill is:

```
{"version":3,"sources":[" [synthetic:es6/util/arrayiterator] "," [synthetic:es6/util/makeiterator] "," [synthetic:es6/util/arrayfromiterable] "," [synthetic:es6/util/arrayfromiterator] "," [synthetic:util/objectcreate] "," [synthetic:util/global] "," [synthetic:es6/util/construct] "," [synthetic:es6/util/setprototypeof] ","src/scoped-custom-element-registry.js"," [synthetic:es6/util/inherits] "], ...the rest
```

### Steps to reproduce

1. Create new [`create-react-app`](https://create-react-app.dev/) application with Typescript
2. Install and import `@webcomponents/scoped-custom-element-registry/`
3. run the build step: `npm run build`

#### Expected behavior
No warnings are shown

#### Actual behavior

Warning above is shown

### Version
@webcomponents/scoped-custom-element-registry@0.0.5

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.