kriasoft / react-starter-kit

The web's most popular Jamstack front-end template (boilerplate) for building web applications with React
https://reactstarter.com
MIT License
22.61k stars 4.15k forks source link

Shipping with Google_Cloud_Credentials Issue #2049

Closed l1ghtn1ngth1ef closed 12 months ago

l1ghtn1ngth1ef commented 1 year ago

Hi there,

The base looks good so I'm thinking to giveit a try but I've run into this after yarn install.

It looks like the boilerplate is shipping with a dependency requirement that isn't satisfied - GOOGLE_CLOUD_CREDENTIALS

I'm sorry to do this to you as I dislike long pastes, but here comes the error, and is there any solution?

Thanks in advance

Replicate: clone repo yarn install yarn start

Node.js v20.2.0 neoverse /var/www/localhost/htdocs/paste # yarn start vite v4.4.3 building for development...

watching for file changes...

build started... transforming... ✓ 38 modules transformed. rendering chunks... computing gzip size... dist/index.js 112.17 kB │ gzip: 25.93 kB built in 642ms. /root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:43 const error = new ZodError_1.ZodError(ctx.common.issues); ^

ZodError: [ { "code": "invalid_union", "unionErrors": [ { "issues": [ { "code": "invalid_union", "unionErrors": [ { "issues": [ { "code": "invalid_type", "expected": "string", "received": "undefined", "path": [ "bindings", "GOOGLE_CLOUD_CREDENTIALS" ], "message": "Required" } ], "name": "ZodError" }, { "issues": [ { "code": "invalid_type", "expected": "number", "received": "undefined", "path": [ "bindings", "GOOGLE_CLOUD_CREDENTIALS" ], "message": "Required" } ], "name": "ZodError" }, { "issues": [ { "code": "invalid_type", "expected": "boolean", "received": "undefined", "path": [ "bindings", "GOOGLE_CLOUD_CREDENTIALS" ], "message": "Required" } ], "name": "ZodError" }, { "issues": [ { "code": "invalid_type", "expected": "null", "received": "undefined", "path": [ "bindings", "GOOGLE_CLOUD_CREDENTIALS" ], "message": "Required" } ], "name": "ZodError" } ], "path": [ "bindings", "GOOGLE_CLOUD_CREDENTIALS" ], "message": "Invalid input" } ], "name": "ZodError" }, { "issues": [ { "code": "invalid_type", "expected": "array", "received": "undefined", "path": [ "bindings", "GOOGLE_CLOUD_CREDENTIALS" ], "message": "Required" } ], "name": "ZodError" }, { "issues": [ { "code": "invalid_type", "expected": "object", "received": "undefined", "path": [ "bindings", "GOOGLE_CLOUD_CREDENTIALS" ], "message": "Required" } ], "name": "ZodError" } ], "path": [ "bindings", "GOOGLE_CLOUD_CREDENTIALS" ], "message": "Invalid input" } ] at get error [as error] (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:43:31) at ZodIntersection.parse (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:141:22) at validateOptions (/root/.yarn/berry/cache/miniflare-npm-3.20230710.0-7049668ed9-10.zip/node_modules/miniflare/dist/src/index.js:8734:49) at new Miniflare (/root/.yarn/berry/cache/miniflare-npm-3.20230710.0-7049668ed9-10.zip/node_modules/miniflare/dist/src/index.js:8957:38) at file:///var/www/localhost/htdocs/paste/scripts/start.js:37:6 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { issues: [ { code: 'invalid_union', unionErrors: [ ZodError: [ { "code": "invalid_union", "unionErrors": [ { "issues": [ { "code": "invalid_type", "expected": "string", "received": "undefined", "path": [ "bindings", "GOOGLE_CLOUD_CREDENTIALS" ], "message": "Required" } ], "name": "ZodError" }, { "issues": [ { "code": "invalid_type", "expected": "number", "received": "undefined", "path": [ "bindings", "GOOGLE_CLOUD_CREDENTIALS" ], "message": "Required" } ], "name": "ZodError" }, { "issues": [ { "code": "invalid_type", "expected": "boolean", "received": "undefined", "path": [ "bindings", "GOOGLE_CLOUD_CREDENTIALS" ], "message": "Required" } ], "name": "ZodError" }, { "issues": [ { "code": "invalid_type", "expected": "null", "received": "undefined", "path": [ "bindings", "GOOGLE_CLOUD_CREDENTIALS" ], "message": "Required" } ], "name": "ZodError" } ], "path": [ "bindings", "GOOGLE_CLOUD_CREDENTIALS" ], "message": "Invalid input" } ] at /root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:1954:56 at Array.map () at ZodUnion._parse (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:1954:40) at ZodLazy._parse (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:2576:27) at ZodRecord._parse (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:2268:34) at ZodOptional._parse (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:2883:36) at ZodObject._parse (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:1656:37) at ZodObject._parseSync (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:127:29) at ZodIntersection._parse (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:2157:33) at ZodIntersection._parseSync (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:127:29) { issues: [ [Object] ], addIssue: [Function (anonymous)], addIssues: [Function (anonymous)], errors: [ [Object] ] }, ZodError: [ { "code": "invalid_type", "expected": "array", "received": "undefined", "path": [ "bindings", "GOOGLE_CLOUD_CREDENTIALS" ], "message": "Required" } ] at /root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:1954:56 at Array.map () at ZodUnion._parse (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:1954:40) at ZodLazy._parse (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:2576:27) at ZodRecord._parse (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:2268:34) at ZodOptional._parse (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:2883:36) at ZodObject._parse (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:1656:37) at ZodObject._parseSync (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:127:29) at ZodIntersection._parse (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:2157:33) at ZodIntersection._parseSync (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:127:29) { issues: [ [Object] ], addIssue: [Function (anonymous)], addIssues: [Function (anonymous)], errors: [ [Object] ] }, ZodError: [ { "code": "invalid_type", "expected": "object", "received": "undefined", "path": [ "bindings", "GOOGLE_CLOUD_CREDENTIALS" ], "message": "Required" } ] at /root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:1954:56 at Array.map () at ZodUnion._parse (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:1954:40) at ZodLazy._parse (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:2576:27) at ZodRecord._parse (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:2268:34) at ZodOptional._parse (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:2883:36) at ZodObject._parse (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:1656:37) at ZodObject._parseSync (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:127:29) at ZodIntersection._parse (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:2157:33) at ZodIntersection._parseSync (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:127:29) { issues: [ [Object] ], addIssue: [Function (anonymous)], addIssues: [Function (anonymous)], errors: [ [Object] ] } ], path: [ 'bindings', 'GOOGLE_CLOUD_CREDENTIALS' ], message: 'Invalid input' } ], addIssue: [Function (anonymous)], addIssues: [Function (anonymous)], errors: [ { code: 'invalid_union', unionErrors: [ ZodError: [ { "code": "invalid_union", "unionErrors": [ { "issues": [ { "code": "invalid_type", "expected": "string", "received": "undefined", "path": [ "bindings", "GOOGLE_CLOUD_CREDENTIALS" ], "message": "Required" } ], "name": "ZodError" }, { "issues": [ { "code": "invalid_type", "expected": "number", "received": "undefined", "path": [ "bindings", "GOOGLE_CLOUD_CREDENTIALS" ], "message": "Required" } ], "name": "ZodError" }, { "issues": [ { "code": "invalid_type", "expected": "boolean", "received": "undefined", "path": [ "bindings", "GOOGLE_CLOUD_CREDENTIALS" ], "message": "Required" } ], "name": "ZodError" }, { "issues": [ { "code": "invalid_type", "expected": "null", "received": "undefined", "path": [ "bindings", "GOOGLE_CLOUD_CREDENTIALS" ], "message": "Required" } ], "name": "ZodError" } ], "path": [ "bindings", "GOOGLE_CLOUD_CREDENTIALS" ], "message": "Invalid input" } ] at /root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:1954:56 at Array.map () at ZodUnion._parse (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:1954:40) at ZodLazy._parse (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:2576:27) at ZodRecord._parse (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:2268:34) at ZodOptional._parse (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:2883:36) at ZodObject._parse (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:1656:37) at ZodObject._parseSync (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:127:29) at ZodIntersection._parse (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:2157:33) at ZodIntersection._parseSync (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:127:29) { issues: [ [Object] ], addIssue: [Function (anonymous)], addIssues: [Function (anonymous)], errors: [ [Object] ] }, ZodError: [ { "code": "invalid_type", "expected": "array", "received": "undefined", "path": [ "bindings", "GOOGLE_CLOUD_CREDENTIALS" ], "message": "Required" } ] at /root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:1954:56 at Array.map () at ZodUnion._parse (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:1954:40) at ZodLazy._parse (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:2576:27) at ZodRecord._parse (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:2268:34) at ZodOptional._parse (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:2883:36) at ZodObject._parse (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:1656:37) at ZodObject._parseSync (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:127:29) at ZodIntersection._parse (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:2157:33) at ZodIntersection._parseSync (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:127:29) { issues: [ [Object] ], addIssue: [Function (anonymous)], addIssues: [Function (anonymous)], errors: [ [Object] ] }, ZodError: [ { "code": "invalid_type", "expected": "object", "received": "undefined", "path": [ "bindings", "GOOGLE_CLOUD_CREDENTIALS" ], "message": "Required" } ] at /root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:1954:56 at Array.map () at ZodUnion._parse (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:1954:40) at ZodLazy._parse (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:2576:27) at ZodRecord._parse (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:2268:34) at ZodOptional._parse (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:2883:36) at ZodObject._parse (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:1656:37) at ZodObject._parseSync (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:127:29) at ZodIntersection._parse (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:2157:33) at ZodIntersection._parseSync (/root/.yarn/berry/cache/zod-npm-3.21.4-9f570b215c-10.zip/node_modules/zod/lib/types.js:127:29) { issues: [ [Object] ], addIssue: [Function (anonymous)], addIssues: [Function (anonymous)], errors: [ [Object] ] } ], path: [ 'bindings', 'GOOGLE_CLOUD_CREDENTIALS' ], message: 'Invalid input' } ] }

Node.js v20.2.0

koistya commented 1 year ago

Oh, good catch! I will fix it shortly. I meanwhile you can launch the app by running:

yarn workspace app start (or, yarn app:start for short)

koistya commented 12 months ago

There was a breaking change in Miniflare v3, I have updated the yarn start script to launch the front-end app directly for now in #2050, I think an updated version of Miniflare is coming soon and then I will update scripts/start.js to make it work with Cloudflare Workers emulator (Miniflare v3).