saleor / saleor-platform

All Saleor services started from a single repository with docker-compose.
BSD 3-Clause "New" or "Revised" License
645 stars 889 forks source link

docker-compose build fails on react-storefront #149

Closed sixthgear closed 2 years ago

sixthgear commented 2 years ago

Hello, today I've attempted to build saleor-platform in multiple places including my Mac M1 Pro and an Ubuntu 20.04 VM. In both cases I've run into the following failure.

Can anyone in the community help me shed some light on this? I'm a little confused as I was able to build the platform previously on the same Ubuntu VM and I'm not using any special environment variables or modifications.

Cheers,

Step 8/13 : RUN pnpm install
 ---> Running in 84b2a229b096
Progress: resolved 1, reused 0, downloaded 0, added 0
Progress: resolved 23, reused 0, downloaded 18, added 0
Progress: resolved 38, reused 0, downloaded 32, added 0
Progress: resolved 48, reused 0, downloaded 45, added 0
Progress: resolved 53, reused 0, downloaded 53, added 0
Progress: resolved 55, reused 0, downloaded 54, added 0
Progress: resolved 78, reused 0, downloaded 62, added 0
Progress: resolved 157, reused 0, downloaded 134, added 0
Progress: resolved 203, reused 0, downloaded 180, added 0
Progress: resolved 261, reused 0, downloaded 237, added 0
Progress: resolved 332, reused 0, downloaded 312, added 0
Progress: resolved 381, reused 0, downloaded 360, added 0
Progress: resolved 466, reused 0, downloaded 444, added 0
Progress: resolved 509, reused 0, downloaded 490, added 0
Progress: resolved 572, reused 0, downloaded 552, added 0
Progress: resolved 624, reused 0, downloaded 602, added 0
Progress: resolved 708, reused 0, downloaded 687, added 0
Progress: resolved 797, reused 0, downloaded 774, added 0
Progress: resolved 818, reused 0, downloaded 805, added 0
Progress: resolved 822, reused 0, downloaded 810, added 0
Progress: resolved 822, reused 0, downloaded 811, added 0
Progress: resolved 823, reused 0, downloaded 811, added 0
Packages: +813
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Packages are hard linked from the content-addressable store to the virtual store.
  Content-addressable store is at: /root/.local/share/pnpm/store/v3
  Virtual store is at:             node_modules/.pnpm
Progress: resolved 824, reused 0, downloaded 813, added 199
Progress: resolved 824, reused 0, downloaded 813, added 806
.../node_modules/core-js-pure postinstall$ node -e "try{require('./postinstall')}catch(e){}"
.../node_modules/core-js-pure postinstall: Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
.../node_modules/core-js-pure postinstall: The project needs your help! Please consider supporting of core-js:
.../node_modules/core-js-pure postinstall: > https://opencollective.com/core-js
.../node_modules/core-js-pure postinstall: > https://patreon.com/zloirock
.../node_modules/core-js-pure postinstall: > https://paypal.me/zloirock
.../node_modules/core-js-pure postinstall: > bitcoin: bc1qlea7544qtsmj2rayg0lthvza9fau63ux0fstcz
.../node_modules/core-js-pure postinstall: Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
.../node_modules/core-js-pure postinstall: Done
Progress: resolved 824, reused 0, downloaded 813, added 813, done

> react-storefront@0.1.0 prepare /app
> husky install

fatal: not a git repository (or any of the parent directories): .git

dependencies:
+ @apollo/client 3.5.10
+ @formatjs/swc-plugin 1.4.0
+ @formatjs/ts-transformer 3.9.2
+ @graphql-codegen/typescript-apollo-client-helpers 2.1.15
+ @headlessui/react 1.5.0
+ @heroicons/react 1.0.5
+ @saleor/sdk 0.4.4
+ @stripe/react-stripe-js 1.7.0
+ @stripe/stripe-js 1.26.0
+ @tailwindcss/aspect-ratio 0.4.0
+ @tailwindcss/forms 0.5.0
+ @tailwindcss/typography 0.5.2
+ clsx 1.1.1
+ dotenv 16.0.0
+ dotenv-cli 5.1.0
+ editorjs-blocks-react-renderer 1.2.4
+ graphql 16.3.0
+ next 12.1.4
+ next-seo 5.3.0
+ next-sitemap 2.4.3
+ next-usequerystate 1.7.0
+ react 18.0.0
+ react-dom 18.0.0
+ react-intl 5.24.6
+ tailwind-scrollbar-hide 1.1.7

devDependencies:
+ @formatjs/cli 4.8.2
+ @graphql-codegen/add 3.1.1
+ @graphql-codegen/cli 2.6.2
+ @graphql-codegen/introspection 2.1.1
+ @graphql-codegen/typescript 2.4.8
+ @graphql-codegen/typescript-operations 2.3.5
+ @graphql-codegen/typescript-react-apollo 3.2.11
+ @next/bundle-analyzer 12.1.4
+ @types/qs 6.9.7
+ @types/react 17.0.43
+ @typescript-eslint/eslint-plugin 5.17.0
+ @typescript-eslint/parser 5.17.0
+ autoprefixer 10.4.2
+ eslint 8.12.0
+ eslint-config-airbnb 19.0.4
+ eslint-config-next 12.1.0
+ eslint-config-prettier 8.4.0
+ eslint-plugin-formatjs 3.0.0
+ eslint-plugin-import 2.25.4
+ eslint-plugin-jsx-a11y 6.5.1
+ eslint-plugin-react 7.29.4
+ eslint-plugin-react-hooks 4.3.0
+ eslint-plugin-simple-import-sort 7.0.0
+ husky 7.0.4
+ pathpida 0.18.1
+ postcss 8.4.12
+ prettier 2.6.2
+ react-hook-form 7.29.0
+ react-use 17.3.2
+ tailwindcss 3.0.23
+ typescript 4.6.3

 ERR_PNPM_PEER_DEP_ISSUES  Unmet peer dependencies

.
├─┬ @graphql-codegen/typescript-react-apollo
│ └── ✕ missing peer graphql-tag@^2.0.0
├─┬ @graphql-codegen/typescript
│ └─┬ @graphql-codegen/visitor-plugin-common
│   └─┬ @graphql-tools/relay-operation-optimizer
│     └─┬ relay-compiler
│       └── ✕ unmet peer graphql@^15.0.0: found 16.3.0
├─┬ @saleor/sdk
│ ├── ✕ unmet peer graphql@^15.5.0: found 16.3.0
│ └── ✕ unmet peer react@"^16.8.0 || ^17.0.0": found 18.0.0
├─┬ react-use
│ ├── ✕ unmet peer react@"^16.8.0  || ^17.0.0": found 18.0.0
│ └── ✕ unmet peer react-dom@"^16.8.0  || ^17.0.0": found 18.0.0
├─┬ @apollo/client
│ └── ✕ unmet peer react@"^16.8.0 || ^17.0.0": found 18.0.0
├─┬ @stripe/react-stripe-js
│ ├── ✕ unmet peer react@"^16.8.0 || ^17.0.0": found 18.0.0
│ └── ✕ unmet peer react-dom@"^16.8.0 || ^17.0.0": found 18.0.0
├─┬ editorjs-blocks-react-renderer
│ └─┬ html-react-parser
│   └── ✕ unmet peer react@"0.14 || 15 || 16 || 17": found 18.0.0
└─┬ react-intl
  └── ✕ unmet peer react@"^16.3.0 || 17": found 18.0.0
Peer dependencies that should be installed:
  graphql-tag@^2.0.0

ERROR: Service 'react-storefront' failed to build : The command '/bin/sh -c pnpm install' returned a non-zero code: 1
matteius commented 2 years ago

Same issue here and since I am brand new to trying out the project it is a real blocking to standing anything up. Any guidance on how to resolve this issue?

linuxipho commented 2 years ago

Same issue too. Retrying many times, but failed on peer dependencies.

Arussil commented 2 years ago

I had the same issue, seems that it's a problem with pnpm 7+. I found a workaround pinning it to 6.32.11 in react-storefront/Dockerfile.dev:

RUN npm install -g pnpm@6.32.11

tusharsrivastava commented 2 years ago

Worked like charm 🎉🎉🎉

reachkrishnaraj commented 2 years ago

@Arussil This worked. Thanks.

midivue commented 2 years ago

@Arussil It worked, cheers!

andrewbanonis commented 2 years ago

@Arussil Just had the same issue. Did what you suggested and worked! You're awesome! Thanks!

ricekab commented 2 years ago

I can confirm the issue still exists, tested under Windows 10 and Ubuntu 20.04 (both WSL and a separate host).

The workaround posted above works.

magul commented 2 years ago

https://github.com/saleor/saleor-platform/pull/158 was merged, which means react-storefront was updated to the newest version. It applies a fix for pnpm issue.

The issue should be solved, so I'm closing this one.