saleor / saleor-storefront

A GraphQL-powered, NextJs-based, PWA storefront for Saleor. IMPORTANT: This project is [DEPRECATED] in favor of saleor/react-storefront soon to become our default demo and storefront starter pack.

Home Page:https://demo.saleor.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Nothing on localhost:3000

GBernard314 opened this issue · comments

What I'm trying to achieve

Seeing the changes as a client.

Steps to reproduce the problem

  1. docker-compose up
  2. going to localhost:3000

What I expected to happen

To have a user friendly store view

Screenshots

Dashboard is working nicely, i guess graphql also (i don't use it yet)
image

System information
Operating system:
image
Browser:
Firefox, Chromium, Curl -> nothing normal on 3000
image

commented

@GBernard314 Hi there! Please follow the instructions from here https://github.com/mirumee/saleor-storefront#getting-started. If you still have any issues, please let us know.

Cheers,

I'm sorry i should have started by saying I was using the docker version of saleor.
That's why I opened the issue because everything else is running but the storefront.

@GBernard314 can you try to start storefront on its own (without docker) and see what happens?

In dockerfile.dev copy and replace this code:

FROM node:10
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
ARG APP_MOUNT_URI
ARG API_URI
ARG STATIC_URL
ENV API_URI ${API_URI:-http://localhost:8000/graphql/}
ENV APP_MOUNT_URI ${APP_MOUNT_URI:-/storefront/}
ENV STATIC_URL ${STATIC_URL:-/storefront/}

EXPOSE 3000
CMD npm start -- --host 0.0.0.0

i tried your answer @ionut98G but it did not change anything

@mehrdad-shokri I'm sorry I cannot try that for the moment, plus I really want to use docker for this.

There's an error in the saleor-platform docker-compose.yml - replace --hostname with --host and it will work. See: saleor/saleor-platform#95

@bhrebec I think there's a bug in storefront because I cant build the project anyway

could Saleor team get working Dockerfile and docker-compose.yml for once? I tried both --hostname and --host, it will either return empty response or NPM would throw errors.

I started all saleor-platform with docker and saleor-storefront with cmder and I set API_URI=http://localhost:8000/graphql/ and then : npm start and it work

I experience the same issue - storfront won't load. I followed the guid to the letter. There is noting obvious in startup logs.
The API_URI is set correctly as I see this from the container:

# echo $API_URI
http://localhost:8000/graphql/

During the startup I see one warning:

storefront_1  | WARNING in EnvironmentPlugin - GTM_ID environment variable is undefined.

but webpack emits files with no problems the whole process ends with:

storefront_1  | ℹ 「wdm」: Compiled with warnings.

if you try npm start from the container I'm getting:

saleor-site@2.11.0 start /app
> cross-env NODE_ENV=develop webpack-dev-server --history-api-fallback --watch --port 3000 --mode development --hotOnly

Starting type checking service...
Using 1 worker with 2048MB memory limit
✖ 「wds」:  { Error: listen EADDRINUSE: address already in use 127.0.0.1:3000
    at Server.setupListenHandle [as _listen2] (net.js:1280:14)
    at listenInCluster (net.js:1328:12)
    at GetAddrInfoReqWrap.doListen [as callback] (net.js:1461:7)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:61:10)
  code: 'EADDRINUSE',
  errno: 'EADDRINUSE',
  syscall: 'listen',
  address: '127.0.0.1',
  port: 3000 }
Browserslist: caniuse-lite is outdated. Please run next command `npm update`

so npm started correctly first time.

The Saleor can you checkout fresh copy from the repo and try for yourself?

@slav-pilus your error indicates that port 3000 is already in use. maybe you haven't closed the previous terminal

This error is expected and it was just to demonstrate that node started correctly in the docker container. The issue is that docker container is not serving storefront on port 3000 (dashboard is working fine).

I don't it is @mehrdad-shokri this issue only occurs in docker container if I run storefront on local everything works as expected.

There's an error in the saleor-platform docker-compose.yml - replace --hostname with --host and it will work. See: mirumee/saleor-platform#95

this did it for me, many thanks !
I'm closing the issue.