Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Investigate adding sourcemaps and removing Babel #5638

Closed
cdock1029 opened this issue Feb 20, 2020 · 6 comments
Closed

Investigate adding sourcemaps and removing Babel #5638

cdock1029 opened this issue Feb 20, 2020 · 6 comments
Labels

Comments

@cdock1029
Copy link

Bug report

Steps to reproduce

  1. Use packages that depend on @material/... components
  2. Build
  3. Observe bundler not finding source files listed in source maps.

Actual behavior

Parcel bundler showing many errors of Could not load source file.... in source map..
because only javascript files are uploaded to npm, but source map is looking for typescript files.

Expected behavior

No error messages polluting the console. The source map is directed to the javascript files or the typescript files are uploaded to npm.

Screenshots

error message

Your Environment:

Software Version(s)
MDC Web 3.2.0
Operating System Pop!_OS 19.10

Additional context

parcel-bundler/parcel#2185

#4206

Possible solution

Upload typescript files to npm.
OR, remove sourcemaps

@cdock1029 cdock1029 added the bug label Feb 20, 2020
@cdock1029 cdock1029 changed the title Source maps listing source files (.ts) not uploaded to npm Source maps refer to non-existent source files (.ts) Feb 20, 2020
@EstebanG23
Copy link
Contributor

Thank you for reporting. Moving to backlog to add ts files.

@allan-chen allan-chen changed the title Source maps refer to non-existent source files (.ts) Investigate adding sourcemaps and removing Babel May 12, 2020
@mattmspie
Copy link

I recently updated react-scripts in a React project that includes @material/circular-progress. I'm now seeing the following warnings during build, that look the same as this issue:

Failed to parse source map from '<path-sanitized>/node_modules/@material/base/component.ts' file : error : ENOENT: no such file or directory, open '<path-sanitized>/node_modules/@material/base/component.ts'

Failed to parse source map from '<path-sanitized>/node_modules/@material/base/foundation.ts' file : error : ENOENT: no such file or directory, open '<path-sanitized>/node_modules/@material/base/foundation.ts'

Failed to parse source map from '<path-sanitized>/node_modules/@material/circular-progress/adapter.ts' file : error : ENOENT: no such file or directory, open '<path-sanitized>/node_modules/@material/circular-progress/adapter.ts'  

Failed to parse source map from '<path-sanitized>/node_modules/@material/circular-progress/component.ts' file : error : ENOENT: no such file or directory, open '<path-sanitized>/node_modules/@material/circular-progress/component.ts'

Failed to parse source map from '<path-sanitized>/node_modules/@material/circular-progress/constants.ts' file : error : ENOENT: no such file or directory, open '<path-sanitized>/node_modules/@material/circular-progress/constants.ts'

Failed to parse source map from '<path-sanitized>/node_modules/@material/circular-progress/foundation.ts' file : error : ENOENT: no such file or directory, open '<path-sanitized>/node_modules/@material/circular-progress/foundation.ts'

Failed to parse source map from '<path-sanitized>/node_modules/@material/circular-progress/index.ts' file : error : ENOENT: no such file or directory, open '<path-sanitized>/node_modules/@material/circular-progress/index.ts'

As a quick test, I updated the .map files corresponding to the warnings above to change "sources":["filename.ts"] to "sources":["filename.js"] and the warnings went away.

@mattmspie
Copy link

@allan-chen Is there a chance this issue and #5904 could be separated and the title restored to "Source maps refer to non-existent source files (.ts)" (i.e. undo your May 12, 2020 edits)? This issue is a bug report whereas investigating a move away from Babel is a more invasive chore. For example, if this issue is restored to focus just on the broken sitemaps, then PR #7506 could actually be sufficient to close this issue.

@mattmspie
Copy link

I didn't heard back from @allan-chen on my last comment. Any chance @acdvorak might be able to weigh-in on my request? I see you have done some maintenance of the webpack and typescript configs.

@asyncLiz
Copy link
Contributor

asyncLiz commented Feb 3, 2022

Hi @mattmspie! I believe this issue is obsolete now that we're focusing on Material You. MDC will soon enter maintenance-only mode.

We'll keep this in mind for the Material You components and packaging! We definitely want sourcemaps for them :)

@asyncLiz asyncLiz closed this as completed Feb 3, 2022
@mattmspie
Copy link

@asyncLiz - I appreciate that the focus is on Material You now, but I'd like to ask (beg?) just once more that the original bug reported in this ticket be addressed while the project is still maintained. The original reporter correctly titled this ticket to indicate a bug:

Source maps refer to non-existent source files (.ts)

For projects where warnings are treated as errors during build, this misconfiguration in sitemap generation causes the build to fail. I've had to resort to including a fork of this project just to resolve this problem.

It's unfortunate that @allan-chen revised this ticket to have a much larger scope than the original report, because with the current title of "Investigate adding sourcemaps and removing Babel", I can totally understand reluctance to investigate. If this ticket could be restored to its original title, the bug could be addressed with a single line change: #7506 . Since source maps are currently broken (and lead to warnings during builds where this package is included), disabling sitemaps during tsc should not be a regression.

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

No branches or pull requests

4 participants