swellstores / horizon

Headless NextJS storefront starter powered by Swell
https://swell-horizon-demo.vercel.app/
MIT License
61 stars 62 forks source link

Problem during local installation #4

Closed lucadaolio closed 1 year ago

lucadaolio commented 1 year ago

Hi, I have a problem when I run locally the project, after I create the .env file.

That's the error: https://nextjs.org/docs/messages/module-not-found wait - compiling... error - ./lib/graphql/client.ts:2:0 Module not found: Can't resolve 'lib/graphql/generated/sdk' 1 | import { GraphQLClient } from 'graphql-request';

2 | import { getSdk } from 'lib/graphql/generated/sdk'; // THIS FILE IS THE GENERATED FILE 3 | 4 | const storeUrl = process.env.NEXT_PUBLIC_SWELL_STORE_URL; 5 | const graphqlEndpoint = ${storeUrl}/graphql;

Import trace for requested module: ./pages/_app.tsx

Steps to reproduce:

  1. Clone project locally.
  2. Create .env file with the required data.
  3. Run nvm install npm install -g npm@8 npm install
  4. Error.

How can I resolve this error?

Thanks in advance.

alextutii commented 1 year ago

Hi @lucadaolio!

While Horizon is still in beta, there's some extra steps that need to be followed to configure your store to how Horizon expects it. Here's a link to the docs that explains how to do that: https://developers.swell.is/guides/deploy-horizon-to-vercel. We'll add this to the README soon.

This setup will be automatically handled in the official release of Horizon.

lucadaolio commented 1 year ago

Hi @alextutii, thanks for feedback.

When will the official version be released?

alextutii commented 1 year ago

@lucadaolio We’re at the last stages of development. Horizon depends on changes to the storefront dashboard and other complex features like how the platform handles app-specific content fields. We also wanted to ensure product quality and stability before releasing it to the public.