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

When installed in my app and run build I got warnings #42

Open
stefanak-michal opened this issue Jan 21, 2023 · 6 comments
Open

When installed in my app and run build I got warnings #42

stefanak-michal opened this issue Jan 21, 2023 · 6 comments

Comments

@stefanak-michal
Copy link
Contributor

I have reactjs app with this project. When I run "react-scripts build" I get a lot of these errors:

Failed to parse source map from 'C:\Projects\cyphergui\node_modules\@memgraph\orb\src\common\color.ts' file: Error: ENOENT: no such file or directory, open 'C:\Projects\cyphergui\no
de_modules\@memgraph\orb\src\common\color.ts'

Failed to parse source map from 'C:\Projects\cyphergui\node_modules\@memgraph\orb\src\common\distance.ts' file: Error: ENOENT: no such file or directory, open 'C:\Projects\cyphergui
\node_modules\@memgraph\orb\src\common\distance.ts'

I don't understand why it tries to reach "src" directory while in my node_modules it contains only "dist". I've added the package with "npm install @memgraph/orb".

image

It is not problem when I run it locally where it takes it as warnings and build is finished and works. But when I run it in CI it acts like errors and it crash.

What I can do about it?

@cizl
Copy link
Contributor

cizl commented Jan 24, 2023

I'm not too familiar with react-scripts, but it's really strange that it works locally and not during CI.
I'll try setting up a similar environment. In the meantime you can maybe try disabling sourcemaps in your .env? Or running something like GENERATE_SOURCEMAP=false react-scripts build instead.

@stefanak-michal
Copy link
Contributor Author

When you run in CI it sets environment variable called CI. With this variable it takes warnings as errors. I disabled it temporally with setting CI env var to empty value.

@cizl
Copy link
Contributor

cizl commented Jan 25, 2023

Oh, I get it. So you managed to make it work for now by ignoring the warnings. Not ideal, I'll definitely investigate the issue but can't promise anything for the immediate future. Thanks for reporting it!
If you have a project setup repo that you can share that would be very helpful. 😄

@stefanak-michal
Copy link
Contributor Author

I hit this problem with https://github.com/stefanak-michal/cyphergui/

When you want to test it locally you have to set env variable CI=true and execute npm run build

@cizl
Copy link
Contributor

cizl commented Jan 25, 2023

Thanks a lot!

@eacaps
Copy link

eacaps commented Aug 11, 2023

I believe this issue stems from the fact that the source maps in the distribution reference the ts files which are not included in the npm package:
/dist/orb.js.map:

{"version":3,"file":"orb.js","sourceRoot":"","sources":["../src/orb.ts"],...

There are 2 options to fix this,

  1. Remove source-map from the webpack configuration when bundling the non-development package
  2. Include the src folder in the npm distribution

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

No branches or pull requests

3 participants