Hashnode / starter-kit

A blog starter kit to use Hashnode as a Headless CMS using GraphQL APIs.

Home Page:https://hashnode.com/headless

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build is failing on cloudflare pages

maheshrijal opened this issue · comments

Tried deploying to cloudflare & ran into issues.

Build settings

Build command: npm run build
Build output directory: /public
Root directory: /packages/blog-starter-kit/themes/personal

Error

2023-10-17T15:58:11.433883Z	Cloning repository...
2023-10-17T15:58:12.482752Z	From https://github.com/maheshrjl/starter-kit
2023-10-17T15:58:12.483383Z	 * branch            39fbe4c2707c7fa119377735c50e74d1694e6c25 -> FETCH_HEAD
2023-10-17T15:58:12.483548Z	
2023-10-17T15:58:12.568478Z	HEAD is now at 39fbe4c Add links to demo videos on YouTube
2023-10-17T15:58:12.569178Z	
2023-10-17T15:58:12.692253Z	
2023-10-17T15:58:12.731877Z	Success: Finished cloning repository files
2023-10-17T15:58:13.659212Z	Detected the following tools from environment: pnpm@8.7.1, nodejs@18.17.1
2023-10-17T15:58:14.735509Z	Installing project dependencies: pnpm install
2023-10-17T15:58:15.660693Z	 ERR_PNPM_OUTDATED_LOCKFILE  Cannot install with "frozen-lockfile" because pnpm-lock.yaml is not up to date with package.json
2023-10-17T15:58:15.661138Z	
2023-10-17T15:58:15.661352Z	Note that in CI environments this setting is true by default. If you still need to run install in such cases, use "pnpm install --no-frozen-lockfile"
2023-10-17T15:58:15.661536Z	
2023-10-17T15:58:15.661724Z	    Failure reason:
2023-10-17T15:58:15.661923Z	    specifiers in the lockfile ({"@graphql-typed-document-node/core":"^3.2.0","@tailwindcss/typography":"^0.5.10","classnames":"^2.3.1","date-fns":"^2.28.0","graphql-request":"^6.1.0","gray-matter":"^4.0.3","next":"latest","react":"^18.2.0","react-dom":"^18.2.0","remark":"^14.0.2","remark-html":"^15.0.1","typescript":"^4.7.4","@graphql-codegen/cli":"^5.0.0","@graphql-codegen/typed-document-node":"^5.0.1","@graphql-codegen/typescript":"^4.0.1","@graphql-codegen/typescript-operations":"^4.0.1","@parcel/watcher":"^2.3.0","@types/node":"^18.0.3","@types/react":"^18.0.15","@types/react-dom":"^18.0.6","autoprefixer":"^10.4.7","concurrently":"^8.2.1","postcss":"^8.4.14","tailwindcss":"^3.1.4"}) don't match specs in package.json ({"@graphql-codegen/cli":"^5.0.0","@graphql-codegen/typed-document-node":"^5.0.1","@graphql-codegen/typescript":"^4.0.1","@graphql-codegen/typescript-operations":"^4.0.1","@parcel/watcher":"^2.3.0","@starter-kit/eslint-config-custom":"workspace:*","@starter-kit/tsconfig":"workspace:*","@types/js-cookie":"^3.0.4","@types/node":"^18.0.3","@types/react":"^18.0.15","@types/react-dom":"^18.0.6","@types/uuid":"^9.0.5","autoprefixer":"^10.4.7","concurrently":"^8.2.1","eslint":"^8.51.0","postcss":"^8.4.14","@graphql-typed-document-node/core":"^3.2.0","@radix-ui/react-dropdown-menu":"^2.0.6","@radix-ui/react-popover":"^1.0.7","@starter-kit/utils":"workspace:*","@tailwindcss/typography":"^0.5.10","@vercel/og":"^0.5.18","date-fns":"^2.30.0","graphql-request":"^6.1.0","gray-matter":"^4.0.3","html-react-parser":"^4.2.2","js-cookie":"^3.0.5","react-waypoint":"^10.3.0","remark":"^14.0.2","remark-html":"^15.0.1","uuid":"^9.0.1"})
2023-10-17T15:58:15.713562Z	Error: Exit with error code: 1
2023-10-17T15:58:15.713945Z	    at ChildProcess.<anonymous> (/snapshot/dist/run-build.js)
2023-10-17T15:58:15.714202Z	    at Object.onceWrapper (node:events:652:26)
2023-10-17T15:58:15.714345Z	    at ChildProcess.emit (node:events:537:28)
2023-10-17T15:58:15.714459Z	    at ChildProcess._handle.onexit (node:internal/child_process:291:12)
2023-10-17T15:58:15.726708Z	Failed: build command exited with code: 1
2023-10-17T15:58:16.864919Z	Failed: error occurred while running build command

Thanks for the report. We have tested it only on Vercel so far. We're going to take a look at it tomorrow!

Hello @maheshrjl
Thanks for the report. We have fixed the above issue.

But I want to inform you that this starter-kit code is not edge compatible. This code needs a full fledged nodejs runtime to run properly, which is not available with cloudflare pages AFAIK. Cloudflare pages provides a edge only runtime which will not be able to support this code.

However, you can still use a lot of code in this starter-kit to create an edge compattible version that will work nicely on cloudflare pages.