orb
orb copied to clipboard
When installed in my app and run build I got warnings
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".
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?
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.
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.
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. :smile:
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
Thanks a lot!
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,
- Remove source-map from the webpack configuration when bundling the non-development package
- Include the src folder in the npm distribution