swellstores / horizon

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

Issue deploying to Vercel #10

Closed osaket closed 1 year ago

osaket commented 1 year ago

[08:54:07.162] Cloning github.com/osaket/swell-horizon (Branch: main, Commit: 52e0513) [08:54:07.452] Previous build cache not available [08:54:08.215] Cloning completed: 1.053s [08:54:08.958] Running "vercel build" [08:54:09.620] Vercel CLI 28.6.0 [08:54:10.176] Warning: Due to "engines": { "node": "^16.15" } in your package.json file, the Node.js Version defined in your Project Settings ("18.x") will not apply. Learn More: http://vercel.link/node-version [08:54:10.223] Installing dependencies... [08:54:13.273] npm WARN ERESOLVE overriding peer dependency [08:54:13.274] npm WARN While resolving: relay-compiler@12.0.0 [08:54:13.274] npm WARN Found: graphql@16.3.0 [08:54:13.274] npm WARN node_modules/graphql [08:54:13.275] npm WARN graphql@"^16.3.0" from the root project [08:54:13.275] npm WARN 38 more (@graphql-codegen/cli, @graphql-codegen/core, ...) [08:54:13.275] npm WARN [08:54:13.275] npm WARN Could not resolve dependency: [08:54:13.275] npm WARN peer graphql@"^15.0.0" from relay-compiler@12.0.0 [08:54:13.275] npm WARN node_modules/relay-compiler [08:54:13.276] npm WARN relay-compiler@"12.0.0" from @graphql-tools/relay-operation-optimizer@6.4.5 [08:54:13.276] npm WARN node_modules/@graphql-tools/relay-operation-optimizer [08:54:13.276] npm WARN [08:54:13.276] npm WARN Conflicting peer dependency: graphql@15.8.0 [08:54:13.276] npm WARN node_modules/graphql [08:54:13.277] npm WARN peer graphql@"^15.0.0" from relay-compiler@12.0.0 [08:54:13.277] npm WARN node_modules/relay-compiler [08:54:13.277] npm WARN relay-compiler@"12.0.0" from @graphql-tools/relay-operation-optimizer@6.4.5 [08:54:13.277] npm WARN node_modules/@graphql-tools/relay-operation-optimizer [08:54:13.387] npm WARN ERESOLVE overriding peer dependency [08:54:13.387] npm WARN While resolving: webpack-filter-warnings-plugin@1.2.1 [08:54:13.388] npm WARN Found: webpack@5.70.0 [08:54:13.388] npm WARN node_modules/webpack [08:54:13.388] npm WARN dev webpack@"^5.69.1" from the root project [08:54:13.388] npm WARN 24 more (@pmmmwh/react-refresh-webpack-plugin, ...) [08:54:13.388] npm WARN [08:54:13.388] npm WARN Could not resolve dependency: [08:54:13.389] npm WARN peer webpack@"^2.0.0 || ^3.0.0 || ^4.0.0" from webpack-filter-warnings-plugin@1.2.1 [08:54:13.389] npm WARN node_modules/webpack-filter-warnings-plugin [08:54:13.389] npm WARN webpack-filter-warnings-plugin@"^1.2.1" from @storybook/builder-webpack4@6.5.10 [08:54:13.389] npm WARN node_modules/@storybook/builder-webpack4 [08:54:13.389] npm WARN [08:54:13.390] npm WARN Conflicting peer dependency: webpack@4.46.0 [08:54:13.390] npm WARN node_modules/webpack [08:54:13.390] npm WARN peer webpack@"^2.0.0 || ^3.0.0 || ^4.0.0" from webpack-filter-warnings-plugin@1.2.1 [08:54:13.391] npm WARN node_modules/webpack-filter-warnings-plugin [08:54:13.391] npm WARN webpack-filter-warnings-plugin@"^1.2.1" from @storybook/builder-webpack4@6.5.10 [08:54:13.391] npm WARN node_modules/@storybook/builder-webpack4 [08:54:23.681] npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated [08:54:24.119] npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. [08:54:24.657] npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated [08:54:24.769] npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility [08:54:24.891] npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated [08:54:25.207] npm WARN deprecated sane@4.1.0: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added [08:54:25.267] npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated [08:54:25.788] npm WARN deprecated querystring@0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead. [08:54:28.617] npm WARN deprecated subscriptions-transport-ws@0.11.0: The subscriptions-transport-ws package is no longer maintained. We recommend you use graphql-ws instead. For help migrating Apollo software to graphql-ws, see https://www.apollographql.com/docs/apollo-server/data/subscriptions/#switching-from-subscriptions-transport-ws For general help using graphql-ws, see https://github.com/enisdenjo/graphql-ws/blob/master/README.md [08:54:32.203] npm WARN deprecated @types/tailwindcss@3.1.0: This is a stub types definition. tailwindcss provides its own type definitions, so you do not need this installed. [08:54:36.136] npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies [08:54:36.240] npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead. [08:54:51.594] npm WARN deprecated core-js-pure@3.21.1: core-js-pure@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js-pure. [08:54:51.603] npm WARN deprecated core-js@3.21.1: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js. [08:54:55.655] [08:54:55.655] > @swell/horizon@0.2.0 prepare [08:54:55.655] > husky install && if [ -f codegen.yml ] && [ -f build-utils/generate-theme.mjs ]; then npm run setup; fi [08:54:55.655] [08:54:55.737] husky - Git hooks installed [08:54:56.130] [08:54:56.130] > @swell/horizon@0.2.0 setup [08:54:56.130] > npm run graphql:generate && npm run theme:generate [08:54:56.131] [08:54:56.521] [08:54:56.522] > @swell/horizon@0.2.0 graphql:generate [08:54:56.522] > graphql-codegen --config codegen.yml -r dotenv/config [08:54:56.522] [08:54:57.556] [22:54:57] Parse configuration [started] [08:54:57.559] [22:54:57] Parse configuration [completed] [08:54:57.560] [22:54:57] Generate outputs [started] [08:54:57.561] [22:54:57] Generate ./graphql.schema.json [started] [08:54:57.561] [22:54:57] Generate lib/graphql/generated/sdk.ts [started] [08:54:57.562] [22:54:57] Load GraphQL schemas [started] [08:54:57.562] [22:54:57] Load GraphQL schemas [started] [08:54:59.625] [22:54:59] Load GraphQL schemas [failed] [08:54:59.626] [22:54:59] → Failed to load schema [08:54:59.626] [22:54:59] Load GraphQL schemas [failed] [08:54:59.626] [22:54:59] → Failed to load schema [08:54:59.627] [22:54:59] Generate ./graphql.schema.json [failed] [08:54:59.627] [22:54:59] → Failed to load schema [08:54:59.627] [22:54:59] Generate lib/graphql/generated/sdk.ts [failed] [08:54:59.627] [22:54:59] → Failed to load schema [08:54:59.627] [22:54:59] Generate outputs [failed] [08:54:59.628] Something went wrong Failed to load schema for "lib/graphql/generated/sdk.ts" [08:54:59.629] Failed to load schema from https://testerkit--dev.swell.store//graphql: [08:54:59.629] [08:54:59.629] Could not obtain introspection result, received: {"errors":[{"message":"Must provide query string."}]} [08:54:59.629] Error: Could not obtain introspection result, received: {"errors":[{"message":"Must provide query string."}]} [08:54:59.629] at getSchemaFromIntrospection (/vercel/path0/node_modules/@graphql-tools/wrap/index.js:1752:11) [08:54:59.630] at /vercel/path0/node_modules/@graphql-tools/wrap/index.js:1768:32 [08:54:59.630] at processTicksAndRejections (node:internal/process/task_queues:96:5) [08:54:59.630] at async UrlLoader.load (/vercel/path0/node_modules/@graphql-tools/url-loader/index.js:755:29) [08:54:59.630] at async /vercel/path0/node_modules/@graphql-tools/load/index.js:75:39 [08:54:59.630] at async Promise.all (index 5) [08:54:59.630] at async loadFile (/vercel/path0/node_modules/@graphql-tools/load/index.js:73:9) [08:54:59.630] at async /vercel/path0/node_modules/@graphql-tools/load/index.js:386:25 [08:54:59.630]
[08:54:59.631] GraphQL Code Generator supports: [08:54:59.631] - ES Modules and CommonJS exports (export as default or named export "schema") [08:54:59.631] - Introspection JSON File [08:54:59.631] - URL of GraphQL endpoint [08:54:59.631] - Multiple files with type definitions (glob expression) [08:54:59.631] - String in config file [08:54:59.631]
[08:54:59.632] Try to use one of above options and run codegen again. [08:54:59.632]
[08:54:59.632]
[08:54:59.632] [08:54:59.632] Failed to load schema for "lib/graphql/generated/sdk.ts" [08:54:59.632] Failed to load schema from https://testerkit--dev.swell.store//graphql: [08:54:59.632] [08:54:59.632] Could not obtain introspection result, received: {"errors":[{"message":"Must provide query string."}]} [08:54:59.633] Error: Could not obtain introspection result, received: {"errors":[{"message":"Must provide query string."}]} [08:54:59.633] at getSchemaFromIntrospection (/vercel/path0/node_modules/@graphql-tools/wrap/index.js:1752:11) [08:54:59.633] at /vercel/path0/node_modules/@graphql-tools/wrap/index.js:1768:32 [08:54:59.633] at processTicksAndRejections (node:internal/process/task_queues:96:5) [08:54:59.633] at async UrlLoader.load (/vercel/path0/node_modules/@graphql-tools/url-loader/index.js:755:29) [08:54:59.633] at async /vercel/path0/node_modules/@graphql-tools/load/index.js:75:39 [08:54:59.634] at async Promise.all (index 5) [08:54:59.634] at async loadFile (/vercel/path0/node_modules/@graphql-tools/load/index.js:73:9) [08:54:59.634] at async /vercel/path0/node_modules/@graphql-tools/load/index.js:386:25 [08:54:59.634]
[08:54:59.634] GraphQL Code Generator supports: [08:54:59.634] - ES Modules and CommonJS exports (export as default or named export "schema") [08:54:59.640] - Introspection JSON File [08:54:59.641] - URL of GraphQL endpoint [08:54:59.641] - Multiple files with type definitions (glob expression) [08:54:59.641] - String in config file [08:54:59.641]
[08:54:59.641] Try to use one of above options and run codegen again. [08:54:59.641]
[08:54:59.641]
[08:54:59.657] npm ERR! code 1 [08:54:59.658] npm ERR! path /vercel/path0 [08:54:59.659] npm ERR! command failed [08:54:59.659] npm ERR! command sh -c -- husky install && if [ -f codegen.yml ] && [ -f build-utils/generate-theme.mjs ]; then npm run setup; fi [08:54:59.661] [08:54:59.661] npm ERR! A complete log of this run can be found in: [08:54:59.702] Error: Command "npm install" exited with 1

AdrianRC commented 1 year ago

Hi @osaket! Looking at your logs, it seems like your NEXT_PUBLIC_SWELL_STORE_URL environment variable was set to https://testerkit--dev.swell.store/ when it was expecting https://testerkit.swell.store. Sorry if that wasn't clear from the docs, we've updated our guide for deploying to Vercel with the intent of simplifying the setup process: https://developers.swell.is/guides/deploy-horizon-to-vercel. Please let us know if you're still having issues after following this guide, thanks!