I am trying to repackage a React-based Electron application (instead of just unpacking the appimage release), and I am up against a very confusing build error. I can build it fine in a FHS nix-shell environment, but when I try building it with the mkYarnPackage
nixpkgs builder, I get this build failure:
[eslint] Plugin "react" was conflicted between ".eslintrc" and "BaseConfig » /nix/store/aaa...-heroic-modules-2.4.0/node_modules/eslint-config-react-app/base.js".
Anyone familiar with React, Electron, and yarn able to shed some light on this?
Full build outputs
nix-build failure output
$ nix-build . -A heroic
this derivation will be built:
/nix/store/3k8s4ikh18h0frzad5zrd5w2mjfwbxr7-heroic-2.4.0.drv
building '/nix/store/3k8s4ikh18h0frzad5zrd5w2mjfwbxr7-heroic-2.4.0.drv'...
unpacking sources
unpacking source archive /nix/store/4221zas74lrzkm64w2868gkqcjh584l3-source
source root is source
patching sources
configuring
building
no Makefile, doing nothing
yarn run v1.22.19
warning Skipping preferred cache folder "/homeless-shelter/.cache/yarn" because it is not writable.
warning Selected the next writable cache folder in the list, will be "/build/.yarn-cache-1000".
$ tsc --project electron/tsconfig.json
warning Cannot find a suitable global folder. Tried these: "/usr/local, /homeless-shelter/.yarn"
Done in 3.13s.
yarn run v1.22.19
warning Skipping preferred cache folder "/homeless-shelter/.cache/yarn" because it is not writable.
warning Selected the next writable cache folder in the list, will be "/build/.yarn-cache-1000".
$ react-scripts build
warning Cannot find a suitable global folder. Tried these: "/usr/local, /homeless-shelter/.yarn"
Creating an optimized production build...
Failed to compile.
[eslint] Plugin "react" was conflicted between ".eslintrc" and "BaseConfig » /nix/store/491dfzw1kjszmh3k7hq2ky7jx0s9i050-heroic-modules-2.4.0/node_modules/eslint-config-react-app/base.js".
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Successful build in FHS shell
$ yarn && yarn build-electron && yarn build
yarn install v1.22.19
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning "@emotion/react > @emotion/babel-plugin@11.10.0" has unmet peer dependency "@babel/core@^7.0.0".
warning "@emotion/react > @emotion/babel-plugin > @babel/plugin-syntax-jsx@7.18.6" has unmet peer dependency "@babel/core@^7.0.0-0".
warning " > crc@4.1.1" has unmet peer dependency "buffer@>=6.0.3".
warning "react-scripts > eslint-config-react-app > eslint-plugin-flowtype@8.0.3" has unmet peer dependency "@babel/plugin-syntax-flow@^7.14.5".
warning "react-scripts > eslint-config-react-app > eslint-plugin-flowtype@8.0.3" has unmet peer dependency "@babel/plugin-transform-react-jsx@^7.14.9".
warning " > @testing-library/react@13.3.0" has incorrect peer dependency "react@^18.0.0".
warning " > @testing-library/react@13.3.0" has incorrect peer dependency "react-dom@^18.0.0".
warning " > ts-jest@27.1.5" has unmet peer dependency "jest@^27.0.0".
[4/4] Building fresh packages...
$ husky install
husky - Git hooks installed
Done in 11.28s.
yarn run v1.22.19
$ tsc --project electron/tsconfig.json
Done in 2.82s.
yarn run v1.22.19
$ react-scripts build
Creating an optimized production build...
Compiled successfully.
File sizes after gzip:
256.55 kB build/static/js/main.6f050d18.js
110.04 kB build/static/css/main.b4759d31.css
1.41 kB build/static/js/6.a55ce8aa.chunk.js
783 B build/static/css/6.9124a0d3.chunk.css
The project was built assuming it is hosted at ./.
You can control this with the homepage field in your package.json.
The build folder is ready to be deployed.
Find out more about deployment here:
https://cra.link/deployment
Done in 51.98s.