vercel / examples

Enjoy our curated collection of examples and solutions. Use these patterns to build your own robust and scalable applications.
MIT License
3.61k stars 1.11k forks source link

Error: Build Starter personalization-builder-io #554

Open luctrate opened 1 year ago

luctrate commented 1 year ago

Just wanted to try out the builder-vercel starter. https://vercel.com/templates/next.js/personalization-builder-io

Following Error was thrown, during build stage:

[10:24:00.585] Failed to compile.
[10:24:00.585] 
[10:24:00.587] ./pages/_middleware.tsx:10:59
[10:24:00.587] Type error: Argument of type 'NextCookies' is not assignable to parameter of type 'Record<string, string>'.
[10:24:00.588]   Index signature for type 'string' is missing in type 'NextCookies'.
Full Build Log from Vercel [10:23:10.713] Running build in San Francisco, USA (West) – sfo1 [10:23:10.756] Cloning github.com/luctrate/personalization-test-builder (Branch: main, Commit: 994e176) [10:23:10.902] Previous build cache not available [10:23:11.823] Cloning completed: 1.067s [10:23:11.983] Running "vercel build" [10:23:12.559] Vercel CLI 28.15.3 [10:23:12.866] Installing dependencies... [10:23:13.255] yarn install v1.22.17 [10:23:13.305] info No lockfile found. [10:23:13.315] [1/4] Resolving packages... [10:23:15.138] warning @builder.io/personalization-utils > @builder.io/admin-sdk > graphql-typed-client > subscriptions-transport-ws@0.9.19: 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 [10:23:15.173] warning @builder.io/personalization-utils > @builder.io/admin-sdk > graphql-typed-client > graphql-toolkit@0.3.5: Use @graphql-toolkit/* monorepo packages instead. Check https://github.com/ardatan/graphql-toolkit for more details [10:23:15.287] warning @builder.io/personalization-utils > @builder.io/admin-sdk > graphql-typed-client > @types/graphql@14.5.0: This is a stub types definition. graphql provides its own type definitions, so you do not need this installed. [10:23:15.348] warning @builder.io/personalization-utils > @builder.io/admin-sdk > graphql-typed-client > graphql-toolkit > graphql-import@0.7.1: GraphQL Import has been deprecated and merged into GraphQL Tools, so it will no longer get updates. Use GraphQL Tools instead to stay up-to-date! Check out https://www.graphql-tools.com/docs/migration-from-import for migration and https://the-guild.dev/blog/graphql-tools-v6 for new changes. [10:23:15.373] warning @builder.io/personalization-utils > @builder.io/admin-sdk > graphql-typed-client > graphql-tools@4.0.8: This package has been deprecated and now it only exports makeExecutableSchema.\nAnd it will no longer receive updates.\nWe recommend you to migrate to scoped packages such as @graphql-tools/schema, @graphql-tools/utils and etc.\nCheck out https://www.graphql-tools.com to learn what package you should use instead [10:23:15.464] warning @builder.io/personalization-utils > @builder.io/admin-sdk > graphql-typed-client > graphql-tools > 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. [10:23:15.464] warning @builder.io/personalization-utils > @builder.io/admin-sdk > graphql-typed-client > graphql-toolkit > @kamilkisiela/graphql-tools > 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. [10:23:16.066] warning @builder.io/react > create-react-context > fbjs > core-js@1.2.7: 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. [10:23:18.210] warning jest > jest-cli > jest-config > jest-environment-jsdom > jsdom > w3c-hr-time@1.0.2: Use your platform's native performance.now() and performance.timeOrigin. [10:23:20.870] [2/4] Fetching packages... [10:23:45.670] [3/4] Linking dependencies... [10:23:45.673] warning " > @builder.io/personalization-utils@0.0.7" has unmet peer dependency "@builder.io/sdk@^1.1.20". [10:23:45.673] warning " > @builder.io/personalization-utils@0.0.7" has incorrect peer dependency "react@^16.14.0". [10:23:45.673] warning " > @builder.io/personalization-utils@0.0.7" has incorrect peer dependency "react-dom@^16.14.0". [10:23:45.674] warning " > @builder.io/personalization-utils@0.0.7" has incorrect peer dependency "next@^11.1.3-canary.88". [10:23:45.675] warning "@builder.io/personalization-utils > @builder.io/admin-sdk > graphql-typed-client > graphql-toolkit@0.3.5" has unmet peer dependency "graphql-tag-pluck@^0.8.3". [10:23:45.676] warning "@builder.io/react > create-react-context@0.2.3" has incorrect peer dependency "react@^0.14.0 || ^15.0.0 || ^16.0.0". [10:23:45.677] warning " > @vercel/fetch@6.2.0" has unmet peer dependency "@types/node-fetch@^2.6.1". [10:23:45.677] warning " > @vercel/fetch@6.2.0" has unmet peer dependency "node-fetch@^2.6.7". [10:23:45.677] warning "@vercel/fetch > @vercel/fetch-cached-dns@2.1.2" has unmet peer dependency "node-fetch@^2.6.1". [10:23:45.677] warning "@vercel/fetch > @vercel/fetch-retry@5.1.3" has unmet peer dependency "node-fetch@^2.6.7". [10:23:55.406] [4/4] Building fresh packages... [10:23:55.491] success Saved lockfile. [10:23:55.498] Done in 42.25s. [10:23:55.540] Detected Next.js version: 12.3.4 [10:23:55.543] Running "yarn run build" [10:23:55.766] yarn run v1.22.17 [10:23:55.823] $ next build [10:23:56.414] Attention: Next.js now collects completely anonymous telemetry regarding usage. [10:23:56.415] This information is used to shape Next.js' roadmap and prioritize features. [10:23:56.415] You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL: [10:23:56.415] https://nextjs.org/telemetry [10:23:56.415] [10:23:56.579] info - Linting and checking validity of types... [10:23:57.242] We detected TypeScript in your project and reconfigured your tsconfig.json file for you. Strict-mode is set to false by default. [10:23:57.243] [10:23:57.243] The following suggested values were added to your tsconfig.json. These values can be changed to fit your project's needs: [10:23:57.243] [10:23:57.243] - incremental was set to true [10:23:57.244] [10:23:59.187] [10:23:59.188] ./pages/api/attributes.ts [10:23:59.188] 11:1 Warning: Assign arrow function to a variable before exporting as module default import/no-anonymous-default-export [10:23:59.188] [10:23:59.188] info - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules [10:24:00.585] Failed to compile. [10:24:00.585] [10:24:00.587] ./pages/_middleware.tsx:10:59 [10:24:00.587] Type error: Argument of type 'NextCookies' is not assignable to parameter of type 'Record'. [10:24:00.588] Index signature for type 'string' is missing in type 'NextCookies'. [10:24:00.588] [10:24:00.588]   8 |  [10:24:00.588]   9 |  if (!excludededPrefixes.find((path) => url.pathname?.startsWith(path))) { [10:24:00.588] > 10 |  const rewrite = getPersonalizedRewrite(url.pathname!, req.cookies) [10:24:00.588]   |  ^ [10:24:00.588]   11 |  if (rewrite) { [10:24:00.588]   12 |  url.pathname = rewrite [10:24:00.588]   13 |  return NextResponse.rewrite(url) [10:24:00.627] error Command failed with exit code 1. [10:24:00.628] info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. [10:24:00.655] Error: Command "yarn run build" exited with 1
shuang807 commented 1 year ago

hi, did you find a solution for this? I had the same problem.

luctrate commented 1 year ago

No, sadly not.

rafarc21 commented 1 year ago

Having the same problem. One click deploy for Vercel is broken.