Coder Social home page Coder Social logo

coremedia / coremedia-headless-client-react Goto Github PK

View Code? Open in Web Editor NEW
19.0 19.0 8.0 9.33 MB

Spark - The React Example Application for the CoreMedia Headless Server

License: Other

CSS 0.97% HTML 0.89% JavaScript 16.54% Dockerfile 0.20% TypeScript 81.34% Shell 0.05%
coremedia coremedia-labs headless react

coremedia-headless-client-react's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

coremedia-headless-client-react's Issues

Building docker image failed: "/spark/storybook-static" not found

Describe the bug

I am trying to build the Spark-App in version 2204.0.0 on Windows WSL2 (Ubuntu) using the following commands

pnpm install
pnpm run build

DOCKER_BUILDKIT=1 docker build -t "coremedia/spark-client:latest" ./apps

The “pnpm install” and “pmpn build” works fine, but when I am trying to create the docker images (vor spark app and stitching) I receive the following error:

[+] Building 1.5s (7/9)
=> [internal] load build definition from Dockerfile                                                                                                                0.0s
=> => transferring dockerfile: 38B                                                                                                                                 0.0s
=> [internal] load .dockerignore                                                                                                                                   0.0s
=> => transferring context: 2B                                                                                                                                     0.0s
=> [internal] load metadata for docker.io/library/nginx:1.21-alpine                                                                                                1.2s
=> CANCELED [1/5] FROM docker.io/library/nginx:1.21- alpine@sha256:a74534e76ee1121d418fa7394ca930eb67440deda413848bc67c68138535b989                                 0.2s
=> => resolve docker.io/library/nginx:1.21-alpine@sha256:a74534e76ee1121d418fa7394ca930eb67440deda413848bc67c68138535b989                                          0.0s
=> => sha256:e00351ea626cd356c69e58d33181233b47a904d3b6ee508948d6cc221d7b9cfa 0B / 603B                                                                            0.2s
=> => sha256:a285f0f83eed13cf71ccb560c31dd31b5eb7be0cadb4f43319d6de59aa4e3c70 0B / 7.34MB                                                                          0.2s
=> => sha256:a74534e76ee1121d418fa7394ca930eb67440deda413848bc67c68138535b989 1.65kB / 1.65kB                                                                      0.0s
=> => sha256:529db430e042ecef071f2e88267cee6da18f8ab44d66a0c44348886fdc2e60fc 1.57kB / 1.57kB                                                                      0.0s
=> => sha256:b1c3acb28882519cf6d3a4d7fe2b21d0ae20bde9cfd2c08a7de057f8cfccff15 8.75kB / 8.75kB                                                                      0.0s
=> => sha256:df9b9388f04ad6279a7410b85cedfdcb2208c0a003da7ab5613af71079148139 0B / 2.81MB                                                                          0.2s
=> [internal] load build context                                                                                                                                   0.2s
=> => transferring context: 13.73MB                                                                                                                                0.2s
=> CACHED [2/5] COPY spark/build /usr/share/nginx/html                                                                                                             0.0s
=> ERROR [3/5] COPY spark/storybook-static /usr/share/nginx/html/storybook        0.0s
------
> [3/5] COPY spark/storybook-static /usr/share/nginx/html/storybook:
------
failed to compute cache key: "/spark/storybook-static" not found: not found

I had a look at the Dockerfile at /apps/Dockerfile, and it contains the line

COPY spark/storybook-static /usr/share/nginx/html/storybook

, but the folder spark/storybook-static is not part of the workspace.

To Reproduce
Steps to reproduce the behavior:

  1. Check out v2204.0.0 and build the docker image
  2. See error

Expected behavior
No build error.

Desktop (please complete the following information):

  • OS: Windows 10, WSL2 (Ubuntu)

Fails with coremedia.training

Describe the bug
The client does not work with https://headless-server-preview.cm95.coremedia.training/graphql

To Reproduce
Steps to reproduce the behavior:

  1. Create '.env' file
  2. Put 'COREMEDIA_ENDPOINT=https://headless-server-preview.cm95.coremedia.training/graphql.'
  3. 'pnpm build'
  4. 'pnpm start'
  5. Go 'http://localhost:5173/'
  6. See error '400 - Apollo Client Error'

Expected behavior
The application should work as expected.

Desktop (please complete the following information):

  • OS: Ubuntu
  • Browser FireFox

Failed to resolve entry for package "@coremedia-labs/preview-integration"

Describe the bug
unable to start spark application due to bug in package

To Reproduce
Steps to reproduce the behavior:

  1. navigate to spark folder
  2. pnpm install
  3. pnpm build
    error is thrown
    Failed to resolve entry for package "@coremedia-labs/preview-integration

Expected behavior
spark application should open with
http://localhost:5173/

Screenshots
5173

Detailed Log :
[plugin:vite:import-analysis] Failed to resolve entry for package "@coremedia-labs/preview-integration". The package may have incorrect main/module/exports specified in its package.json.
/Users/spalakal/Documents/Projects/spark-ws-11/coremedia-headless-client-react/apps/spark/src/index.tsx
at packageEntryFailure (file:///Users/spalakal/Documents/Projects/spark-ws-11/coremedia-headless-client-react/node_modules/.pnpm/vite@4.5.0_@types[email protected]/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:28725:11)
at resolvePackageEntry (file:///Users/spalakal/Documents/Projects/spark-ws-11/coremedia-headless-client-react/node_modules/.pnpm/vite@4.5.0_@types[email protected]/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:28722:5)
at tryNodeResolve (file:///Users/spalakal/Documents/Projects/spark-ws-11/coremedia-headless-client-react/node_modules/.pnpm/vite@4.5.0_@types[email protected]/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:28453:20)
at Context.resolveId (file:///Users/spalakal/Documents/Projects/spark-ws-11/coremedia-headless-client-react/node_modules/.pnpm/vite@4.5.0_@types[email protected]/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:28212:28)
at async Object.resolveId (file:///Users/spalakal/Documents/Projects/spark-ws-11/coremedia-headless-client-react/node_modules/.pnpm/vite@4.5.0_@types[email protected]/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:44276:32)
at async TransformContext.resolve (file:///Users/spalakal/Documents/Projects/spark-ws-11/coremedia-headless-client-react/node_modules/.pnpm/vite@4.5.0_@types[email protected]/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:43992:23)
at async normalizeUrl (file:///Users/spalakal/Documents/Projects/spark-ws-11/coremedia-headless-client-react/node_modules/.pnpm/vite@4.5.0_@types[email protected]/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:41836:34)
at async file:///Users/spalakal/Documents/Projects/spark-ws-11/coremedia-headless-client-react/node_modules/.pnpm/vite@4.5.0_@types[email protected]/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:41998:47
at async Promise.all (index 5)
at async TransformContext.transform (file:///Users/spalakal/Documents/Projects/spark-ws-11/coremedia-headless-client-react/node_modules/.pnpm/vite@4.5.0_@types[email protected]/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:41914:13

Desktop (please complete the following information):

  • OS: [MAC os M1]
  • Browser [e.g. chrome]
  • Version [cm 11, 2307.1]

Additional context
stitching and mocking both servers are up and running
stitching server log:
2023-11-28 16:48:04 [INFO] Fetching schemas from GraphQL endpoints
2023-11-28 16:48:04 [INFO] Loading schema from http://localhost:41180/graphql (Headless Server).
2023-11-28 16:48:08 [INFO] Successfully loaded schema from coreMediaHeadlessServerEndpoint.
2023-11-28 16:48:08 [INFO] Loading schema from http://localhost:43180/graphql (Headless Commerce Server).
2023-11-28 16:48:08 [INFO] Successfully loaded schema from commerceCatalogEndpoint.
2023-11-28 16:48:08 [INFO] Campaign Service not configured.
2023-11-28 16:48:08 [INFO] Stitching server started on: http://localhost:4000/graphql

mocking server log:

@coremedia-labs/[email protected] start /Users/spalakal/Documents/Projects/spark-ws-11/coremedia-headless-client-react/servers/mocking
node ./bin/smoke -o all -d 10 mocks

2023-11-28 16:48:15 [INFO] Mocking server started on: http://localhost:5000

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.