vmware-archive / clarity

Clarity is a scalable, accessible, customizable, open source design system built with web components. Works with any JavaScript framework, built for enterprises, and designed to be inclusive.
http://clarity.design
MIT License
6.43k stars 762 forks source link

Source map error and webpack 5 #6695

Closed coryrylan closed 2 years ago

coryrylan commented 2 years ago

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

Expected behavior

The source map paths should not throw in webpack 5

Versions

Clarity project:

Clarity version:

Framework:

github-actions[bot] commented 2 years ago

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.