Cannot deploy a Graphql Pages Plugin - Failed: an internal error occurred

I copied the GraphQL Pages Plugin hello world example to a functions/graphql.ts file (can’t link in posts, but it’s the exact file from the graphql plugin page). I can run this successfully with wrangler pages dev, but when I deploy, I get:

21:20:48.031	Compiled Worker successfully.
21:20:48.048	Validating asset output directory
21:20:49.022	Failed: an internal error occurred

Removing this file makes the deployment work. I’m wondering if anyone has insight? It should be easily reproducible.

This plugin? GraphQL · Cloudflare Pages docs

Can you share your repo? Do you have a package.json with the @cloudflare/pages-plugin-graphql and graphql dependencies? Can you share the full build log?

  1. Repo: (I can’t include links- on github) mhamrah/hamrah.com
  2. Yes, I have that. see package.json in repo above
2022-09-19T01:20:06.196077Z	Cloning repository...
2022-09-19T01:20:07.105397Z	From https://github.com/mhamrah/hamrah.com
2022-09-19T01:20:07.106Z	 * branch            2178cf8a278ce716d921cc858ffbee4f98353cd4 -> FETCH_HEAD
2022-09-19T01:20:07.10624Z	
2022-09-19T01:20:07.149097Z	HEAD is now at 2178cf8 add functions and graphql
2022-09-19T01:20:07.149625Z	
2022-09-19T01:20:07.290104Z	
2022-09-19T01:20:07.315568Z	Success: Finished cloning repository files
2022-09-19T01:20:08.249471Z	Installing dependencies
2022-09-19T01:20:08.260336Z	Python version set to 2.7
2022-09-19T01:20:11.440423Z	Downloading and installing node v14.20.0...
2022-09-19T01:20:11.87014Z	Downloading https://nodejs.org/dist/v14.20.0/node-v14.20.0-linux-x64.tar.xz...
2022-09-19T01:20:12.298914Z	Computing checksum with sha256sum
2022-09-19T01:20:12.42842Z	Checksums matched!
2022-09-19T01:20:16.845895Z	Now using node v14.20.0 (npm v6.14.17)
2022-09-19T01:20:17.236571Z	Started restoring cached build plugins
2022-09-19T01:20:17.249466Z	Finished restoring cached build plugins
2022-09-19T01:20:17.717678Z	Attempting ruby version 2.7.1, read from environment
2022-09-19T01:20:21.157659Z	Using ruby version 2.7.1
2022-09-19T01:20:21.514377Z	Using PHP version 5.6
2022-09-19T01:20:21.671017Z	5.2 is already installed.
2022-09-19T01:20:21.701128Z	Using Swift version 5.2
2022-09-19T01:20:21.70174Z	Started restoring cached node modules
2022-09-19T01:20:21.717009Z	Finished restoring cached node modules
2022-09-19T01:20:21.954788Z	Installing NPM modules using NPM version 6.14.17
2022-09-19T01:20:22.899444Z	npm WARN read-shrinkwrap This version of npm is compatible with [email protected], but package-lock.json was generated for [email protected] I'll try to do my best with it!
2022-09-19T01:20:36.236234Z	
2022-09-19T01:20:36.236565Z	> [email protected] postinstall /opt/buildhome/repo/node_modules/esbuild
2022-09-19T01:20:36.236715Z	> node install.js
2022-09-19T01:20:36.236829Z	
2022-09-19T01:20:36.462222Z	
2022-09-19T01:20:36.462569Z	> [email protected] postinstall /opt/buildhome/repo/node_modules/wrangler/node_modules/esbuild
2022-09-19T01:20:36.462751Z	> node install.js
2022-09-19T01:20:36.462905Z	
2022-09-19T01:20:37.02187Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @esbuild/[email protected] (node_modules/@esbuild/linux-loong64):
2022-09-19T01:20:37.022175Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @esbuild/[email protected]: wanted {"os":"linux","arch":"loong64"} (current: {"os":"linux","arch":"x64"})
2022-09-19T01:20:37.030213Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/wrangler/node_modules/esbuild-windows-64):
2022-09-19T01:20:37.030796Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"win32","arch":"x64"} (current: {"os":"linux","arch":"x64"})
2022-09-19T01:20:37.037605Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/wrangler/node_modules/esbuild-windows-arm64):
2022-09-19T01:20:37.038087Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"win32","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
2022-09-19T01:20:37.046278Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/wrangler/node_modules/esbuild-windows-32):
2022-09-19T01:20:37.046515Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"win32","arch":"ia32"} (current: {"os":"linux","arch":"x64"})
2022-09-19T01:20:37.053193Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/wrangler/node_modules/esbuild-openbsd-64):
2022-09-19T01:20:37.0534Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"openbsd","arch":"x64"} (current: {"os":"linux","arch":"x64"})
2022-09-19T01:20:37.060153Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/wrangler/node_modules/esbuild-sunos-64):
2022-09-19T01:20:37.060366Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"sunos","arch":"x64"} (current: {"os":"linux","arch":"x64"})
2022-09-19T01:20:37.067046Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/wrangler/node_modules/esbuild-netbsd-64):
2022-09-19T01:20:37.067244Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"netbsd","arch":"x64"} (current: {"os":"linux","arch":"x64"})
2022-09-19T01:20:37.074104Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/wrangler/node_modules/esbuild-linux-riscv64):
2022-09-19T01:20:37.074294Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"linux","arch":"riscv64"} (current: {"os":"linux","arch":"x64"})
2022-09-19T01:20:37.081318Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/wrangler/node_modules/esbuild-linux-s390x):
2022-09-19T01:20:37.081544Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"linux","arch":"s390x"} (current: {"os":"linux","arch":"x64"})
2022-09-19T01:20:37.088469Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/wrangler/node_modules/esbuild-linux-mips64le):
2022-09-19T01:20:37.088692Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"linux","arch":"mips64el"} (current: {"os":"linux","arch":"x64"})
2022-09-19T01:20:37.095573Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/wrangler/node_modules/esbuild-linux-ppc64le):
2022-09-19T01:20:37.095757Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"linux","arch":"ppc64"} (current: {"os":"linux","arch":"x64"})
2022-09-19T01:20:37.102557Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/wrangler/node_modules/esbuild-linux-arm64):
2022-09-19T01:20:37.102754Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"linux","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
2022-09-19T01:20:37.110538Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/wrangler/node_modules/esbuild-linux-arm):
2022-09-19T01:20:37.110745Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"linux","arch":"arm"} (current: {"os":"linux","arch":"x64"})
2022-09-19T01:20:37.11745Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/wrangler/node_modules/esbuild-linux-32):
2022-09-19T01:20:37.117653Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"linux","arch":"ia32"} (current: {"os":"linux","arch":"x64"})
2022-09-19T01:20:37.124357Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/wrangler/node_modules/esbuild-freebsd-64):
2022-09-19T01:20:37.124557Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"freebsd","arch":"x64"} (current: {"os":"linux","arch":"x64"})
2022-09-19T01:20:37.131373Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/wrangler/node_modules/esbuild-freebsd-arm64):
2022-09-19T01:20:37.13159Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"freebsd","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
2022-09-19T01:20:37.13825Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/wrangler/node_modules/esbuild-darwin-arm64):
2022-09-19T01:20:37.138554Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
2022-09-19T01:20:37.145999Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/wrangler/node_modules/esbuild-darwin-64):
2022-09-19T01:20:37.146366Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"x64"} (current: {"os":"linux","arch":"x64"})
2022-09-19T01:20:37.153132Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/wrangler/node_modules/esbuild-android-64):
2022-09-19T01:20:37.153331Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"android","arch":"x64"} (current: {"os":"linux","arch":"x64"})
2022-09-19T01:20:37.160332Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/wrangler/node_modules/esbuild-android-arm64):
2022-09-19T01:20:37.160548Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"android","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
2022-09-19T01:20:37.169903Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
2022-09-19T01:20:37.170118Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
2022-09-19T01:20:37.177973Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/esbuild-windows-arm64):
2022-09-19T01:20:37.178185Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"win32","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
2022-09-19T01:20:37.185027Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/esbuild-windows-64):
2022-09-19T01:20:37.185249Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"win32","arch":"x64"} (current: {"os":"linux","arch":"x64"})
2022-09-19T01:20:37.19206Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/esbuild-sunos-64):
2022-09-19T01:20:37.192248Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"sunos","arch":"x64"} (current: {"os":"linux","arch":"x64"})
2022-09-19T01:20:37.199089Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/esbuild-windows-32):
2022-09-19T01:20:37.199311Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"win32","arch":"ia32"} (current: {"os":"linux","arch":"x64"})
2022-09-19T01:20:37.206093Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/esbuild-openbsd-64):
2022-09-19T01:20:37.206329Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"openbsd","arch":"x64"} (current: {"os":"linux","arch":"x64"})
2022-09-19T01:20:37.213111Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/esbuild-netbsd-64):
2022-09-19T01:20:37.213392Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"netbsd","arch":"x64"} (current: {"os":"linux","arch":"x64"})
2022-09-19T01:20:37.220583Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/esbuild-linux-s390x):
2022-09-19T01:20:37.220779Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"linux","arch":"s390x"} (current: {"os":"linux","arch":"x64"})
2022-09-19T01:20:37.228055Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/esbuild-linux-riscv64):
2022-09-19T01:20:37.228245Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"linux","arch":"riscv64"} (current: {"os":"linux","arch":"x64"})
2022-09-19T01:20:37.236212Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/esbuild-linux-ppc64le):
2022-09-19T01:20:37.23652Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"linux","arch":"ppc64"} (current: {"os":"linux","arch":"x64"})
2022-09-19T01:20:37.245488Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/esbuild-linux-mips64le):
2022-09-19T01:20:37.245689Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"linux","arch":"mips64el"} (current: {"os":"linux","arch":"x64"})
2022-09-19T01:20:37.25329Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/esbuild-linux-arm64):
2022-09-19T01:20:37.253534Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"linux","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
2022-09-19T01:20:37.261008Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/esbuild-linux-arm):
2022-09-19T01:20:37.261203Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"linux","arch":"arm"} (current: {"os":"linux","arch":"x64"})
2022-09-19T01:20:37.26872Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/esbuild-linux-32):
2022-09-19T01:20:37.26901Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"linux","arch":"ia32"} (current: {"os":"linux","arch":"x64"})
2022-09-19T01:20:37.276612Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/esbuild-freebsd-arm64):
2022-09-19T01:20:37.276818Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"freebsd","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
2022-09-19T01:20:37.28425Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/esbuild-freebsd-64):
2022-09-19T01:20:37.284484Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"freebsd","arch":"x64"} (current: {"os":"linux","arch":"x64"})
2022-09-19T01:20:37.292016Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/esbuild-darwin-64):
2022-09-19T01:20:37.292262Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"x64"} (current: {"os":"linux","arch":"x64"})
2022-09-19T01:20:37.299835Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/esbuild-darwin-arm64):
2022-09-19T01:20:37.300033Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
2022-09-19T01:20:37.307683Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/esbuild-android-arm64):
2022-09-19T01:20:37.307911Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"android","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
2022-09-19T01:20:37.31528Z	npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/esbuild-android-64):
2022-09-19T01:20:37.31565Z	npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"android","arch":"x64"} (current: {"os":"linux","arch":"x64"})
2022-09-19T01:20:37.315997Z	
2022-09-19T01:20:37.319327Z	added 520 packages from 346 contributors and audited 560 packages in 14.463s
2022-09-19T01:20:37.503405Z	
2022-09-19T01:20:37.503758Z	187 packages are looking for funding
2022-09-19T01:20:37.503929Z	  run `npm fund` for details
2022-09-19T01:20:37.504124Z	
2022-09-19T01:20:37.504322Z	found 0 vulnerabilities
2022-09-19T01:20:37.50448Z	
2022-09-19T01:20:37.525107Z	NPM modules installed
2022-09-19T01:20:37.92421Z	Installing Hugo 0.54.0
2022-09-19T01:20:38.613798Z	Hugo Static Site Generator v0.54.0-B1A82C61A/extended linux/amd64 BuildDate: 2019-02-01T10:04:38Z
2022-09-19T01:20:38.618809Z	Started restoring cached go cache
2022-09-19T01:20:38.637907Z	Finished restoring cached go cache
2022-09-19T01:20:38.790207Z	go version go1.14.4 linux/amd64
2022-09-19T01:20:38.804699Z	go version go1.14.4 linux/amd64
2022-09-19T01:20:38.807502Z	Installing missing commands
2022-09-19T01:20:38.807755Z	Verify run directory
2022-09-19T01:20:38.807899Z	Executing user command: npm run build
2022-09-19T01:20:39.165865Z	
2022-09-19T01:20:39.166164Z	> @example/[email protected] build /opt/buildhome/repo
2022-09-19T01:20:39.166321Z	> astro build
2022-09-19T01:20:39.166467Z	
2022-09-19T01:20:41.972828Z	01:20:41 AM [build] output target: server
2022-09-19T01:20:41.973136Z	01:20:41 AM [build] deploy adapter: @astrojs/cloudflare
2022-09-19T01:20:41.973298Z	01:20:41 AM [build] Collecting build info...
2022-09-19T01:20:41.973694Z	01:20:41 AM [build] Completed in 25ms.
2022-09-19T01:20:41.974606Z	01:20:41 AM [build] Building server entrypoints...
2022-09-19T01:20:47.250857Z	01:20:47 AM [build] Completed in 5.28s.
2022-09-19T01:20:47.258851Z	
2022-09-19T01:20:47.259148Z	 finalizing server assets 
2022-09-19T01:20:47.25931Z	
2022-09-19T01:20:47.25949Z	01:20:47 AM [build] Rearranging server assets...
2022-09-19T01:20:47.292321Z	01:20:47 AM [build] Server built in 5.34s
2022-09-19T01:20:47.292582Z	01:20:47 AM [build] Complete!
2022-09-19T01:20:47.31884Z	Finished
2022-09-19T01:20:47.879304Z	🚧 'wrangler pages <command>' is a beta command. Please report any issues to https://github.com/cloudflare/wrangler2/issues/new/choose
2022-09-19T01:20:48.031Z	Compiled Worker successfully.
2022-09-19T01:20:48.048572Z	Validating asset output directory
2022-09-19T01:20:49.022001Z	Failed: an internal error occurred