Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
michaelwarren1106 opened this issue Jul 29, 2022 · 3 comments
Open

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

michaelwarren1106 opened this issue Jul 29, 2022 · 3 comments

Comments

@michaelwarren1106
Copy link

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:\<APP DIRECTORY>\node_modules\@webcomponents\scoped-custom-element-registry\scoped-custom-element-registry.min.js.map' file: Error: ENOENT: no such file or directory, open 'C:\<APP DIRECTORY>\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 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/[email protected]

@bicknellr
Copy link
Collaborator

IIRC, those weird bracketed source paths are placed there by Closure to represent its injected polyfills. I was messing around with updating some dependencies a while ago and I believe a newer version of Closure fixed this.

@justinfagnani
Copy link
Collaborator

Do we think this is fixed now? I replaced Gulp with a direct call to Closure and noticed that the sourcemaps are slightly different.

@michaelwarren1106
Copy link
Author

i haven’t seen an error in a long time, and we’ve dumped create-react-app like the rest of the react world has, so i’d call it good for now and re-open if something else comes up?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants