scottyzen / woonuxt-settings

WordPress plugin to help setup WooNuxt
18 stars 5 forks source link

Error fetching woonuxt settings + Failed to load schema + Error: read ECONNRESET #15

Closed stefaniancusfn closed 4 weeks ago

stefaniancusfn commented 4 weeks ago

Hello, we're trying to deploy from Vercel and we have this issues. We tried several things like NODE_TLS_REJECT..=0, disabling/enabling the plugin, enabling Public Introspection, adding the graphql endpoint in Extend "Access-Control-Allow-Origin” header field and we didn't manage to figure it out.

We are using Wordpress hosted on EC2 with ALB and CloudFront.

If we use local wordpress backend it works as it should.

This is what we see in Wordpress dashboard:

Screenshot 2024-09-17 at 12 53 17

And the endpoint works in browser/Postman:

Screenshot 2024-09-17 at 12 47 47

But when we're trying to deploy from Vercel we get:

[17:04:42.653] Running build in Washington, D.C., USA (East) – iad1 [17:04:42.745] Cloning (Branch: master, Commit: d98b839) [17:04:42.753] Skipping build cache, deployment was triggered without cache. [17:04:43.661] Cloning completed: 915.009ms [17:04:43.967] Running "vercel build" [17:04:44.378] Vercel CLI 37.4.0 [17:04:44.994] Installing dependencies... [17:04:49.892] npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported [17:04:50.534] npm warn deprecated npmlog@5.0.1: This package is no longer supported. [17:04:50.826] npm warn deprecated ohmyfetch@0.4.21: Package renamed to https://github.com/unjs/ofetch [17:04:51.171] npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. [17:04:51.401] npm warn deprecated glob@8.1.0: Glob versions prior to v9 are no longer supported [17:04:51.725] npm warn deprecated gauge@3.0.2: This package is no longer supported. [17:04:52.236] npm warn deprecated are-we-there-yet@2.0.0: This package is no longer supported. [17:04:53.830] npm warn deprecated @babel/plugin-proposal-object-rest-spread@7.20.7: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-object-rest-spread instead. [17:04:53.830] npm warn deprecated @babel/plugin-proposal-class-properties@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead. [17:04:54.373] npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported [17:04:54.493] npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported [17:04:54.964] npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported [17:04:55.193] npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported [17:04:58.466] [17:04:58.466] > postinstall [17:04:58.466] > nuxt prepare [17:04:58.466] [17:05:00.687] [log] [1;35mError fetching woonuxt settings. Make sure you have the latest version woonuxt-settings plugin installed and activated WordPress. You can download it from https://github.com/scottyzen/woonuxt-settings [17:06:01.591] [error] [17:06:01.592] Failed to load schema from https://mydomain.com/graphql: [17:06:01.592] [17:06:01.592] read ECONNRESET [17:06:01.592] Error: read ECONNRESET [17:06:01.592] at TLSWrap.onStreamRead (node:internal/stream_base_commons:218:20) [17:06:01.592] [17:06:01.592] GraphQL Code Generator supports: [17:06:01.592] - ES Modules and CommonJS exports (export as default or named export "schema") [17:06:01.592] - Introspection JSON File [17:06:01.592] - URL of GraphQL endpoint [17:06:01.592] - Multiple files with type definitions (glob expression) [17:06:01.592] - String in config file [17:06:01.592] [17:06:01.592] Try to use one of above options and run codegen again. [17:06:01.592] [17:06:01.592]
[17:06:01.592] Failed to load schema from https://mydomain.com/graphql: [17:06:01.593]
[17:06:01.593] read ECONNRESET [17:06:01.593] Error: read ECONNRESET [17:06:01.593] at TLSWrap.onStreamRead (node:internal/stream_base_commons:218:20) [17:06:01.593]
[17:06:01.593] GraphQL Code Generator supports: [17:06:01.593] - ES Modules and CommonJS exports (export as default or named export "schema") [17:06:01.593] - Introspection JSON File [17:06:01.593] - URL of GraphQL endpoint [17:06:01.593] - Multiple files with type definitions (glob expression) [17:06:01.593] - String in config file [17:06:01.593]
[17:06:01.593] Try to use one of above options and run codegen again. [17:06:01.593]
[17:06:01.593]
[17:06:01.593] at executeCodegen (node_modules/@graphql-codegen/cli/esm/codegen.js:330:24) [17:06:01.593] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [17:06:01.593] at async generate (node_modules/@graphql-codegen/cli/esm/generate-and-save.js:99:25) [17:06:01.593] at async generate (node_modules/nuxt-graphql-client/dist/module.mjs:65:10) [17:06:01.593] at async generateGqlTypes (node_modules/nuxt-graphql-client/dist/module.mjs:340:46) [17:06:01.593] at async setup (node_modules/nuxt-graphql-client/dist/module.mjs:435:5) [17:06:01.593] at async normalizedModule (node_modules/@nuxt/kit/dist/index.mjs:2136:17) [17:06:01.593] at async installModule (node_modules/@nuxt/kit/dist/index.mjs:2478:95) [17:06:01.594] at async initNuxt (node_modules/nuxt/dist/index.mjs:4493:5) [17:06:01.594] at async loadNuxt (node_modules/nuxt/dist/index.mjs:4660:5) [17:06:01.594] at async loadNuxt (node_modules/@nuxt/kit/dist/index.mjs:2664:19) [17:06:01.594] at async Object.run (node_modules/nuxi/dist/chunks/prepare.mjs:61:18) [17:06:01.594] at async runCommand$1 (node_modules/nuxi/dist/shared/nuxi.fefc5017.mjs:1648:16) [17:06:01.594] at async runCommand$1 (node_modules/nuxi/dist/shared/nuxi.fefc5017.mjs:1639:11) [17:06:01.594] at async runMain$1 (node_modules/nuxi/dist/shared/nuxi.fefc5017.mjs:1777:7) [17:06:01.594]
[17:06:01.594] Error: [17:06:01.594] Failed to load schema from https://mydomain.com/graphql: [17:06:01.594]
[17:06:01.594] read ECONNRESET [17:06:01.594] Error: read ECONNRESET [17:06:01.594] at TLSWrap.onStreamRead (node:internal/stream_base_commons:218:20) [17:06:01.594]
[17:06:01.594] GraphQL Code Generator supports: [17:06:01.594] - ES Modules and CommonJS exports (export as default or named export "schema") [17:06:01.594] - Introspection JSON File [17:06:01.594] - URL of GraphQL endpoint [17:06:01.594] - Multiple files with type definitions (glob expression) [17:06:01.594] - String in config file [17:06:01.594]
[17:06:01.594] Try to use one of above options and run codegen again. [17:06:01.594]
[17:06:01.595]
[17:06:01.595] at loadSchema (node_modules/@graphql-codegen/cli/esm/load.js:42:15) [17:06:01.595] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [17:06:01.595] at async node_modules/@graphql-codegen/cli/esm/codegen.js:186:69 [17:06:01.595] at async node_modules/@graphql-codegen/cli/esm/codegen.js:185:56 [17:06:01.595] at async node_modules/@graphql-codegen/cli/esm/codegen.js:62:17 [17:06:01.595] at async Task.run (node_modules/listr2/dist/index.js:960:11) [17:06:01.595] at async node_modules/p-map/index.js:57:22 [17:06:01.595] [17:06:01.595] [error] ... (23 lines left)

stefaniancusfn commented 4 weeks ago

LE: After just posting this I thought that we should also try the endpoint with trailing slash:

https://mydomain.com/graphql/

So for anybody who's has redirect non trailing slash to trailing slash URLs, don't forget to add that as well because it seems the redirect is not supported (yet).

scottyzen commented 3 weeks ago

Hi @stefaniancusfn, Have you set up at least one product attribute? It's something that WooGrapghQL requires. Also if you send me your GrapghQL endpoint I'll take a look and see if I can find out whats going on