Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot install and run theme from fresh clone #57

Open
amaidah opened this issue Nov 27, 2023 · 3 comments
Open

Cannot install and run theme from fresh clone #57

amaidah opened this issue Nov 27, 2023 · 3 comments

Comments

@amaidah
Copy link

amaidah commented Nov 27, 2023

After cloning this repo, adding .env and running yarn:

❯ yarn dev
yarn run v1.22.21
$ yarn setup && next dev
$ yarn sync && yarn graphql:generate && yarn theme:generate
$ node -r dotenv/config ./build-utils/sync-storefront.mjs
✔ Successfully set editor values for [abc].
Enabled editor: true
Source theme id: horizon

exec error: Error: Command failed: swell storefronts push --id $SWELL_STOREFRONT_ID -t settings -s defaults -f ./config/defaults.json --secret-key $SWELL_SECRET_KEY --store $SWELL_STORE_ID

✔ Successfully pushed theme.horizon.memberships model to [abc] store.

✔ Successfully pushed theme.horizon.multiple_features model to [abc] store.

✔ Successfully pushed theme.horizon.multiple_panels model to [abc] store.

✔ Successfully pushed theme.horizon.press_mentions_carousel model to [abc] store.

✔ Successfully pushed theme.horizon.products_preview model to [abc]store.

✔ Successfully pushed theme.horizon.full_width_media model to [abc]store.

✔ Successfully pushed theme.horizon.reviews model to [abc] store.

✔ Successfully pushed theme.horizon.heading_with_text model to [abc] store.

✔ Successfully pushed theme.horizon.categories_preview model to [abc] store.

✔ Successfully pushed theme.horizon.divider model to [abc] store.

✔ Successfully pushed theme.horizon.quiz_question model to [abc] store.

{
  errors: {
    fields: {
      message: "Content field name '6563e6bfc6f1320011833ef2' should not start with a number",
      code: 'INVALID'
    }
  }
}

{
  errors: {
    fields: {
      message: "Content field name '6563e6bf9328cf00126e2330' should not start with a number",
      code: 'INVALID'
    }
  }
}

✔ Successfully pushed theme.horizon.quiz_transition model to [abc] store.

✔ Successfully pushed theme.horizon.category model to [abc] store.

✔ Successfully pushed theme.horizon.product model to [abc] store.

exec error: Error: Command failed: swell storefronts push --id $SWELL_STOREFRONT_ID -t editor -s defaults -f ./config/editor.json --secret-key $SWELL_SECRET_KEY --store $SWELL_STORE_ID

$ graphql-codegen --config codegen.yml -r dotenv/config
✔ Parse Configuration
✔ Generate outputs
$ node -r dotenv/config ./build-utils/generate-theme.mjs
file:///code/[abc]/build-utils/styles.mjs:15
  Object.entries(object).forEach(([key, value]) => {
         ^

TypeError: Cannot convert undefined or null to object
    at Function.entries (<anonymous>)
    at getVarsFromObject (file:///code/[abc]/build-utils/styles.mjs:15:10)
    at generateCssVars (file:///code/[abc]/build-utils/styles.mjs:33:21)
    at file:///code/[abc]/build-utils/generate-theme.mjs:13:19
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v18.18.2
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
@unknownsouls
Copy link

unknownsouls commented Jan 12, 2024

@amaidah did you find a fix?

getting similar push error

yarn run v1.22.19
$ yarn setup && next dev
$ yarn sync && yarn graphql:generate && yarn theme:generate
$ node -r dotenv/config ./build-utils/sync-storefront.mjs
exec error: Error: Command failed: swell storefronts push --id $SWELL_STOREFRONT_ID -t settings -s defaults -f ./config/defaults.json --secret-key $SWELL_SECRET_KEY --store $SWELL_STORE_ID

✔ Successfully set editor values for xyz storefront 7Vxxxxxxyyyyzzzi.
Enabled editor: true
Source theme id: horizon

exec error: Error: Command failed: swell storefronts push --id $SWELL_STOREFRONT_ID -t editor -s defaults -f ./config/editor.json --secret-key $SWELL_SECRET_KEY --store $SWELL_STORE_ID

✔ Successfully pushed theme.horizon.heading_with_text model to xyzstore.

✔ Successfully pushed theme.horizon.multiple_panels model to xyz store.

✔ Successfully pushed theme.horizon.divider model to xyz store.

✔ Successfully pushed theme.horizon.full_width_media model to xyz store.

✔ Successfully pushed theme.horizon.reviews model to xyz store.

✔ Successfully pushed theme.horizon.products_preview model to xyz store.

✔ Successfully pushed theme.horizon.memberships model to xyz store.

✔ Successfully pushed theme.horizon.quiz_question model to xyz store.

✔ Successfully pushed theme.horizon.multiple_features model to xyz store.

✔ Successfully pushed theme.horizon.quiz_transition model to xyz store.

✔ Successfully pushed theme.horizon.quiz model to xyz store.

✔ Successfully pushed theme.horizon.categories_preview model to xyz store.

✔ Successfully pushed theme.horizon.page model to xyz store.

✔ Successfully pushed theme.horizon.press_mentions_carousel model to xyz store.

✔ Successfully pushed theme.horizon.product model to xyz store.

✔ Successfully pushed theme.horizon.category model to xyz store.

$ graphql-codegen --config codegen.yml -r dotenv/config
✔ Parse Configuration
⚠ Generate outputs
❯ Generate to ./graphql.schema.json

Failed to load schema from https://xyz.swell.store//graphql:
socket hang up
Error: socket hang up
at connResetException (node:internal/errors:705:14)
at TLSSocket.socketOnEnd (node:_http_client:518:23)
at TLSSocket.emit (node:events:525:35)
at TLSSocket.emit (node:domain:489:12)
at endReadableNT (node:internal/streams/readable:1358:12)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
GraphQL Code Generator supports:
- ES Modules and CommonJS exports (export as default or named export "schema")
- Introspection JSON File
- URL of GraphQL endpoint
- Multiple files with type definitions (glob expression)
- String in config file
Try to use one of above options and run codegen again.
◼ Load GraphQL documents
◼ Generate
❯ Generate to lib/graphql/generated/sdk.ts

Failed to load schema from https://xyz.swell.store//graphql:
socket hang up
Error: socket hang up
at connResetException (node:internal/errors:705:14)
at TLSSocket.socketOnEnd (node:_http_client:518:23)
at TLSSocket.emit (node:events:525:35)
at TLSSocket.emit (node:domain:489:12)
at endReadableNT (node:internal/streams/readable:1358:12)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
GraphQL Code Generator supports:
- ES Modules and CommonJS exports (export as default or named export "schema")
- Introspection JSON File
- URL of GraphQL endpoint
- Multiple files with type definitions (glob expression)
- String in config file
Try to use one of above options and run codegen again.
◼ Load GraphQL documents
◼ Generate
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@unknownsouls
Copy link

Swell is aware of this. Work around available here: https://github.com/orgs/swellstores/discussions/451

@jacobraccuia
Copy link

jacobraccuia commented Jan 24, 2024

I am running into a similar issue, the posted workaround above did not work. Fresh install of Horizon, just trying to use the theme for the first time.

yarn run v1.22.21
warning ../../../package.json: No license field
$ yarn setup && next dev
warning ../../../package.json: No license field
$ yarn sync && yarn graphql:generate && yarn theme:generate
warning ../../../package.json: No license field
$ node -r dotenv/config ./build-utils/sync-storefront.mjs
✔ Successfully set editor values for xxx storefront XXXX.
Enabled editor: true
Source theme id: horizon

✔ Successfully updated settings configuration for xxx storefront XXX.
✔ Successfully pushed theme.horizon.divider model to xxx store.
✔ Successfully pushed theme.horizon.heading_with_text model to xxx store.
✔ Successfully pushed theme.horizon.full_width_media model to xxx store.
✔ Successfully pushed theme.horizon.categories_preview model to xxx store.
✔ Successfully pushed theme.horizon.memberships model to xxx store.
✔ Successfully pushed theme.horizon.multiple_panels model to xxx store.
✔ Successfully pushed theme.horizon.press_mentions_carousel model to xxx store.
✔ Successfully pushed theme.horizon.quiz_transition model to xxx store.
✔ Successfully pushed theme.horizon.reviews model to xxx store.
✔ Successfully pushed theme.horizon.quiz_question model to xxx store.
✔ Successfully pushed theme.horizon.products_preview model to xxx store.
✔ Successfully pushed theme.horizon.multiple_features model to xxx store.
✔ Successfully pushed theme.horizon.product model to xxx store.
✔ Successfully pushed theme.horizon.quiz model to xxx store.
✔ Successfully updated editor configuration for xxx storefront XXX.
✔ Successfully pushed theme.horizon.category model to xxx store.
✔ Successfully pushed theme.horizon.page model to xxx store.

warning ../../../package.json: No license field
$ graphql-codegen --config codegen.yml -r dotenv/config
✔ Parse Configuration
⚠ Generate outputs
  ❯ Generate to ./graphql.schema.json
    ✔ Load GraphQL schemas
    ✔ Load GraphQL documents
    ✖ GraphQL Document Validation failed with 9 errors;
      Error 0: Cannot query field "content" on type "SwellCategory".
- Swell Storefront/horizon/lib/graphql/que…
      Error 1: Cannot query field "productHighlights" on type "SwellProductContent".
    Swell Storefront/horizon/lib/graphql/que…
      Error 2: Cannot query field "expandableDetails" on type "SwellProductContent".
   Swell Storefront/horizon/lib/graphql/que…
      Error 3: Cannot query field "layoutOptions" on type "SwellProductContent".
   Swell Storefront/horizon/lib/graphql/que…
      Error 4: Cannot query field "showStockLevels" on type "SwellProductContent".
     Swell Storefront/horizon/lib/graphql/que…
      Error 5: Cannot query field "lowStockIndicator" on type "SwellProductContent".
      at / Swell Storefront/horizon/lib/graphql/que…
      Error 6: Cannot query field "calloutTitle" on type "SwellProductContent".
      at / Swell Storefront/horizon/lib/graphql/que…
      Error 7: Cannot query field "calloutDescription" on type "SwellProductContent".
      at / - Swell Storefront/horizon/lib/graphql/que…
      Error 8: Cannot query field "enableProductCounter" on type "SwellProductContent".
      at / - Swell Storefront/horizon/lib/graphql/que…
  ❯ Generate to lib/graphql/generated/sdk.ts
    ✔ Load GraphQL schemas
    ✔ Load GraphQL documents
    ✖ GraphQL Document Validation failed with 9 errors;
      Error 0: Cannot query field "content" on type "SwellCategory".
      Error 1: Cannot query field "productHighlights" on type "SwellProductContent".
      Error 2: Cannot query field "expandableDetails" on type "SwellProductContent".
      Error 3: Cannot query field "layoutOptions" on type "SwellProductContent".
      Error 4: Cannot query field "showStockLevels" on type "SwellProductContent".
      Error 5: Cannot query field "lowStockIndicator" on type "SwellProductContent".
      Error 6: Cannot query field "calloutTitle" on type "SwellProductContent".
      Error 7: Cannot query field "calloutDescription" on type "SwellProductContent".
      Error 8: Cannot query field "enableProductCounter" on type "SwellProductContent".
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants