storefront icon indicating copy to clipboard operation
storefront copied to clipboard

Failed to compile @saleor/checkout-storefront

Open slamer59 opened this issue 2 years ago • 1 comments

Summary

Hello, I am facing a strange issue using dev dockerfile. I can locally use it but cannot in deployed in "dev environement:

./pages/checkout-spa.tsx:5:27
Module not found: Can't resolve '@saleor/checkout-storefront'
  3 | const CheckoutStoreFront = Dynamic(
  4 |   async () => {
> 5 |     const { Root } = await import("@saleor/checkout-storefront");
    |                           ^
  6 |     return Root;
  7 |   },
  8 |   {

https://nextjs.org/docs/messages/module-not-found


I just want to run saleor-app-checkout

ARG NODE_VERSION=16
ARG ALPINE_VERSION=3.15

FROM node:${NODE_VERSION}-alpine${ALPINE_VERSION} 
WORKDIR /app

# Setup proxy to API used in saleor-platform
# RUN apt-get update && apt-get install -y nginx
# COPY ./nginx/dev.conf /etc/nginx/conf.d/default.conf
ARG NEXT_PUBLIC_STOREFRONT_NAME
ARG NEXT_PUBLIC_HOMEPAGE_MENU
ARG NEXT_PUBLIC_DEMO_MODE
ARG NEXT_PUBLIC_GEOLOCATION
ARG NEXT_PUBLIC_ALLOWED_IMAGE_DOMAINS
ARG NEXT_PUBLIC_IMAGE_CONVERSION_FORMATS
ARG NEXT_PUBLIC_API_URI
ARG NEXT_PUBLIC_DEFAULT_CHANNEL
ARG NEXT_PUBLIC_VERCEL_URL

ENV NEXT_PUBLIC_STOREFRONT_NAME=${NEXT_PUBLIC_STOREFRONT_NAME}
ENV NEXT_PUBLIC_HOMEPAGE_MENU=${NEXT_PUBLIC_HOMEPAGE_MENU}
ENV NEXT_PUBLIC_DEMO_MODE=${NEXT_PUBLIC_DEMO_MODE}
ENV NEXT_PUBLIC_GEOLOCATION=${NEXT_PUBLIC_GEOLOCATION}
ENV NEXT_PUBLIC_ALLOWED_IMAGE_DOMAINS=${NEXT_PUBLIC_ALLOWED_IMAGE_DOMAINS}
ENV NEXT_PUBLIC_IMAGE_CONVERSION_FORMATS=${NEXT_PUBLIC_IMAGE_CONVERSION_FORMATS}
ENV NEXT_PUBLIC_API_URI=${NEXT_PUBLIC_API_URI:-http:/localhost:8000/graphql/}
ENV NEXT_PUBLIC_DEFAULT_CHANNEL ${NEXT_PUBLIC_DEFAULT_CHANNEL:-default-channel}
ENV NEXT_TELEMETRY_DISABLED 1

# Setup pnpm package manager
RUN npm install --location=global [email protected]

COPY . .
RUN pnpm install


ARG SALEOR_API_URL
ENV SALEOR_API_URL ${SALEOR_API_URL:-http://localhost:8000/graphql/}

EXPOSE 3001
CMD pnpm turbo run dev --parallel --cache-dir=.turbo --filter=saleor-app-checkout

What goes wrong ?

Steps to reproduce

  1. Building the Dockerfile above
  2. Run it
  3. Got to root page

A link to a reproduction repository

No response

Output from envinfo

No response

slamer59 avatar Oct 08 '22 07:10 slamer59

Hello @slamer59 👋

Where is the Dockerfile coming from?

peelar avatar Oct 10 '22 10:10 peelar

Hello, Its custom. Derived from this repo.

slamer59 avatar Oct 11 '22 07:10 slamer59

This won't work because you're only running saleor-app-checkout (--filter=saleor-app-checkout). @saleor/checkout-storefront is not a part of it.

You should be running at least saleor app checkout and all its dependencies via the ... operator from turbo: --filter=saleor-app-checkout...

Let me know if this helps. However, in general, we're unable to provide help with code that didn't come from us - i.e. a custom Dockerfile.

typeofweb avatar Oct 11 '22 08:10 typeofweb

This issue had no activity for more than 90 days. Labelling as stale.

It'll be automatically closed withing 30 days of no activity.

github-actions[bot] avatar Jan 10 '23 02:01 github-actions[bot]

Closing due to lack of activity.

typeofweb avatar Jan 10 '23 11:01 typeofweb