fix(website): restore Cloudflare Worker after the Next.js upgrade by Jocs · Pull Request #5698 · marktext/marktext · GitHub
Skip to content

fix(website): restore Cloudflare Worker after the Next.js upgrade - #5698

Merged
Jocs merged 1 commit into
developfrom
fix/website-worker-next-compat
Oct 11, 2026
Merged

Jocs merged 1 commit into
developfrom
fix/website-worker-next-compat

Conversation

@Jocs

@Jocs Jocs commented Oct 11, 2026

Copy link
Copy Markdown
Member

Related: #5687 (dependency upgrade that introduced the regression).

Summary

Requests to marktext.me returned HTTP 500 / Cloudflare 1101 after #5687 upgraded Next.js to 16.4.0. Production Worker logs and a local reproduction both showed Unexpected loadManifest(/.next/server/preview-props.json) call!: Next.js loads this new manifest during server initialization, but OpenNext 1.20.10 does not inline it. Builds and deployments still succeeded.

Pin Next.js to 15.5.27, the latest 15.x patch and a version accepted by the current OpenNext adapter. Keep the other dependency upgrades. Use Next 15's required jsx: preserve setting and add the CSS import declaration needed by TypeScript 6.

Add a local Workers HTTP smoke test before production and preview uploads in GitHub Actions. It checks the homepage, documentation, robots.txt, sitemap.xml, and the search index, including response status, content type, and expected content. This catches the original runtime failure that lint, type checking, and builds missed.

Type of change

  • Bug fix (non-breaking, fixes an issue)
  • Documentation update

Test plan

  • New runtime smoke test: fails with HTTP 500 on the original Next.js 16.4.0 bundle; passes on the fixed bundle.
  • Manually tested on macOS with local workerd and the production Cloudflare Worker.
  • Website lint, type checking, OpenNext build, and cf:smoke passed.
  • Root pnpm run lint passed (existing warnings).
  • Root pnpm run typecheck: blocked during Muya declaration generation by missing local dependencies (marked, marked-highlight, fuse.js, and others); only the website dependency tree was installed for this incident. Website type checking passes independently.
  • Production checks after the emergency deployment: homepage, developer documentation, robots.txt, and sitemap.xml return HTTP 200; www redirects to the apex with HTTP 301.

Notes for reviewers

The fixed Worker was already deployed directly to restore service (version adc71ba3-0809-4b03-b5ba-c49c6924aff6). Merge this PR to persist the fix in the GitHub Actions deployment source. The smoke test validates local runtime behavior; it does not check production DNS, credentials, or domain routing. Revisit the version pin when OpenNext supports the new manifest.

Before:

GET https://marktext.me/ -> 500, error code: 1101
Worker exception: Unexpected loadManifest(/.next/server/preview-props.json) call!

After:

GET https://marktext.me/ -> 200
GET https://marktext.me/docs/dev/architecture -> 200
GET https://www.marktext.me/?smoke=1 -> 301
Location: https://marktext.me/?smoke=1

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

Build artifacts for PR #5698:

Run: https://github.com/marktext/marktext/actions/runs/38110693417

Artifact Size Link
marktext-linux 660.8 MB Download
marktext-windows-arm64 288.3 MB Download
marktext-macos-arm64 297.6 MB Download
marktext-windows-x64 296.5 MB Download
marktext-macos-x64 310.9 MB Download

@Jocs
Jocs merged commit 895fa97 into develop Oct 11, 2026
19 checks passed
@Jocs
Jocs deleted the fix/website-worker-next-compat branch October 11, 2026 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant