vmware-archive/clarity

Source map error and webpack 5

coryrylan opened this issue · 1 comments

Describe the bug

In the latest Webpack 5 it will throw an error/warning about the source map paths being incorrect. This is easiest to replicate in create react app but since it's likely a webpack specific issue it could occur in any webpack based build setup.

I believe the solution is to set sourcemapExcludeSources: true, to false.

https://github.com/vmware/clarity/blob/next/packages/core/rollup.config.js#L75

WARNING in ./node_modules/@cds/core/progress-circle/progress-circle.utils.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/my-app/node_modules/src/progress-circle/progress-circle.utils.ts' file: Error: ENOENT: no such file or directory, open '/my-app/node_modules/src/progress-circle/progress-circle.utils.ts'
 @ ./node_modules/@cds/core/progress-circle/progress-circle.element.js 4:0-74 14:11-12
 @ ./node_modules/@cds/core/progress-circle/register.js 2:0-70 3:25-26
 @ ./node_modules/@cds/core/button/register.js 2:0-47
 @ ./node_modules/@cds/core/alert/register.js 1:0-38
 @ ./node_modules/@cds/react/alert/index.js 2:0-34
 @ ./src/App.js 5:0-44 11:35-43
 @ ./src/index.js 7:0-24 11:33-36

How to reproduce

  • install create react app
  • install the latest stable @cds/react 5.6.4 and 6.x

Expected behavior

The source map paths should not throw in webpack 5

Versions

Clarity project:

  • Clarity Core
  • Clarity Angular/UI

Clarity version:

  • v3.x
  • v4.x
  • v5.x
  • v6.x

Framework:

  • Angular
  • React
  • Vue
  • Other:

Hi there 👋, this is an automated message. To help Clarity keep track of discussions, we automatically lock closed issues after 14 days. Please look for another open issue or open a new issue with updated details and reference this one as necessary.