launchdarkly / react-client-sdk

LaunchDarkly Client-side SDK for React.js
Other
85 stars 68 forks source link

Sourcemaps point to non-published files #66

Closed kalley closed 2 years ago

kalley commented 3 years ago

Is this a support request? No

Describe the bug During a webpack build, I get a bunch of the following that webpack luckily just treats as errors:

WARNING in ../node_modules/launchdarkly-react-client-sdk/lib/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/path/to/node_modules/src/index.ts' file: Error: ENOENT: no such file or directory, open '/path/to/node_modules/src/index.ts'
 @ ./src/index.tsx 13:0-68 63:19-38

It doesn't cause a problem, but it is very annoying and clogs up my console

To reproduce Install the package and bundle with webpack.

Expected behavior There would be no issues during build and my console would be not be full of warnings.

Logs See above

SDK version 2.22.0

Language version, developer tools Node 14.16.1 Webpack 5.35.0

OS/platform Irrelevant to the issue

bwoskow-ld commented 3 years ago

Thanks for filing, @kalley. I've gone ahead and filed this issue on our internal backlog. We don't use webpack internally on this or related projects and so we haven't seen this before, but will take a look.

In the meantime, one workaround to remove the annoying warnings from your build logs would be to configure webpack such that it doesn't try to load sourcemaps for launchdarkly-react-client-sdk. See this answer for more details on how to implement this temporary workaround.

Filed internally as 107070.

kalley commented 3 years ago

@bwoskow-ld Thanks for the link. I'll definitely implement that in the meantime!

MightySCollins commented 2 years ago

Is there an update on this? With the new @next version of react-scripts the warnings are now displayed as an overlay on the screen when its run in dev and are very hard to ignore. It's also not trivial to edit the webpack config to exclude this.

bwoskow-ld commented 2 years ago

Hi @kalley and @MightySCollins, can either of you tell us more about the project or environment in which you're able to reproduce this problem? We weren't able to reproduce the problem with this example app.

kalley commented 2 years ago

@bwoskow-ld I see it when using dev-server. I don't think I've seen it in a production build. dev-server v4 is where you would get the overlay by default, as they changed it there.

MightySCollins commented 2 years ago

@bwoskow-ld Sorry for the delay. I put together a simple replication: https://github.com/MightySCollins/launchdarkly-sdk-example

bwoskow-ld commented 2 years ago

This issue is resolved in version 2.23.3. Thank you for your patience.