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

React: Dev server logs full of warnings regarding source maps #804

Closed
defaude opened this issue Jan 20, 2022 · 15 comments
Closed

React: Dev server logs full of warnings regarding source maps #804

defaude opened this issue Jan 20, 2022 · 15 comments
Labels
react React related stuff

Comments

@defaude
Copy link

defaude commented Jan 20, 2022

Using a freshly-squeezed app made by create-react-app, I'm getting a ton of warnings regarding source maps like

WARNING in ./node_modules/@telekom/scale-components-react/dist/react-component-lib/utils/case.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/code/scale-issues/node_modules/@telekom/scale-components-react/src/react-component-lib/utils/case.ts' file: Error: ENOENT: no such file or directory, open '/code/scale-issues/node_modules/@telekom/scale-components-react/src/react-component-lib/utils/case.ts'
 @ ./node_modules/@telekom/scale-components-react/dist/react-component-lib/utils/index.js 62:13-30
 @ ./node_modules/@telekom/scale-components-react/dist/react-component-lib/createComponent.js 27:16-34
 @ ./node_modules/@telekom/scale-components-react/dist/react-component-lib/index.js 7:24-52
 @ ./node_modules/@telekom/scale-components-react/dist/components.js 13:30-62
 @ ./node_modules/@telekom/scale-components-react/dist/index.js 24:13-36
 @ ./src/App.tsx 5:0-64 10:35-48
 @ ./src/index.tsx 7:0-28 15:33-36

The app itself seems to work just fine, but this behavior in the dev server's console is quite annoying :)

@christopherGdynia
Copy link
Contributor

Hello @defaude

you don't need to use the react wrapper to use Scale in React, see

with this change in the react-app-env.d.ts file you can use the scalecomponents as html elements not as react component.

But either way, the dropdown element isn't working as expected, see this

@defaude
Copy link
Author

defaude commented Jan 21, 2022

I'd strongly prefer using the React wrapper components off-the-shelf instead of having to handle the React <=> Web Component shenanigans myself and/or auto-generating my own wrapper components.

Just pointing out that maybe there's an issue with the source maps generation?

@W1ckh3ad
Copy link

@defaude
Sorry for my last answer, I forgot to tell you that the wrapper libraries will get deprecated.

I don't know if the team behind scale will put any more work into the wrapper library, because you can get it work with the answers of #615

But maybe @acstll or @marvinLaubenstein can give you more details about it

@acstll
Copy link
Collaborator

acstll commented Jan 24, 2022

Hey @defaude thanks for opening this!

Thank you @W1ckh3ad also for contributing.

The Angular and Vue wrapper packages are indeed deprecated.

But the React wrappers are not. The warning says "might" 🙂

The reason for this is the following: Angular and Vue already have great support for web components, but in React support is still experimental (much better now than a year ago, but not quite there yet).

@defaude what version of Scale are you using?

@christopherGdynia
Copy link
Contributor

@acstll it should be beta-43 as in his test repos https://github.com/defaude/scale-reactivity

@defaude
Copy link
Author

defaude commented Jan 24, 2022

Yup, beta-42. Thanks @christopherGdynia 👍

Let's just hope react will eventually get around to properly work with web components ;) Until then, we'll have to make do with some wrapper for react apps.

@acstll acstll added the react React related stuff label Jun 30, 2022
@acstll
Copy link
Collaborator

acstll commented Jun 30, 2022

@defaude are you still getting the warnings with >=beta.100?

@acstll
Copy link
Collaborator

acstll commented Jul 15, 2022

Closing this assuming it's all good, please re-open or get in touch if not. Thanks again for opening this!

@acstll acstll closed this as completed Jul 15, 2022
@defaude
Copy link
Author

defaude commented Aug 12, 2022

Hey @acstll ! Sorry for not getting back to you sooner. In fact, I switched to another company and am no longer part of the project team that used the Scale components. I think they came up with their own "handwritten" Scale React component suite but I'm not sure.

@acstll
Copy link
Collaborator

acstll commented Aug 12, 2022

Hey @defaude, no worries. Thanks a lot for the reply, I really appreciate it. All the best in the new company!

@andoo
Copy link

andoo commented Aug 22, 2022

This issue is still there. It can be reproduced in four steps:

  1. Use create-react-app to create a new npm project
  2. npm install @telekom/scale-components-react
  3. import ScaleAppShell in src/App.js
  4. npm run build

The last command will show all the source map errors. Please see my attached "logfile" for details
scale-source-maps.txt

@tshimber
Copy link
Contributor

hi! please, tell, is it resolved? for me seems not//
I used to have Scale with Angular and now only have first steps with React + Typescript. But I kinda started with all new and simple, and still this issue appears from the start.

Here's the screenshot: https://prnt.sc/qzIOEHJFgqPs

@tshimber
Copy link
Contributor

tshimber commented Jan 31, 2023

it is appearing for React both JS and TS, when you use create-react-app (it will be now react 18.2.0), which uses react-scripts 5.0.1. If manually change react-scripts version to 2.1.3, this issue got resolved, but a lot of deprecated stuff appears.

Scale of newest versions as well:
"@telekom/scale-components": "^3.0.0-beta.119",
"@telekom/scale-components-react": "^3.0.0-beta.56"

@acstll acstll reopened this Feb 1, 2023
@felix-ico
Copy link
Collaborator

Hi @tshimber I've looked into this topic a bit and it seems like the problem is related to create-react-app (discussion: facebook/create-react-app#11767). There is a workaround suggested at the end of that thread to at least remove the warnings from the console: facebook/create-react-app#11767 (comment). Would this be doable for you?

@tshimber
Copy link
Contributor

tshimber commented Feb 1, 2023

Hi @felix-ico ! thanks a lot! sorry I was blaming Scale by default and couldn't even think, that it's React unresolved issue:/// really strange from their side/
We provide the basic solution for other developers, so I guess providing this strange workarounds by default would be a doubtful idea. Maybe we'll go with prev version of react-scripts, which is 4.0.3, with this one it works fine/

THANK YOU ones again!

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

No branches or pull requests

7 participants