Skip to content

Conversation

@kdaviduik
Copy link
Contributor

@kdaviduik kdaviduik commented Sep 9, 2025

Summary

  • Added @typescript-eslint/no-floating-promises and @typescript-eslint/no-misused-promises ESLint rules
  • Applied to both root repository config and skeleton template
  • Helps prevent "The script will never generate a response" errors on Oxygen/Cloudflare Workers

Why these changes?

Cloudflare recommends enabling these ESLint rules to catch promise handling issues that can cause runtime errors in Workers environments. When promises are not properly awaited or returned, Workers may terminate the script prematurely, leading to the dreaded "The script will never generate a response" error.

Reference: Cloudflare Workers Error Documentation

What's changed

  1. Root eslint.config.js: Added the two promise rules to the TypeScript strict configuration for linted packages
  2. Skeleton template eslint.config.js: Added the same rules so new Hydrogen projects have these safeguards from the start
  3. Changeset: Added for the skeleton template change (as it affects distributed code)

Added @typescript-eslint/no-floating-promises and @typescript-eslint/no-misused-promises
rules to both the root eslint config and skeleton template. These rules help prevent
"The script will never generate a response" errors when deploying to Oxygen/Cloudflare
Workers by ensuring promises are properly handled.

Reference: https://developers.cloudflare.com/workers/observability/errors/#the-script-will-never-generate-a-response-errors
@shopify
Copy link
Contributor

shopify bot commented Sep 9, 2025

Oxygen deployed a preview of your add-eslint-promise-rules branch. Details:

Storefront Status Preview link Deployment details Last update (UTC)
Skeleton (skeleton.hydrogen.shop) ✅ Successful (Logs) Preview deployment Inspect deployment September 9, 2025 2:56 AM
third-party-queries-caching ✅ Successful (Logs) Preview deployment Inspect deployment September 9, 2025 2:56 AM
custom-cart-method ✅ Successful (Logs) Preview deployment Inspect deployment September 9, 2025 2:56 AM
metaobjects ✅ Successful (Logs) Preview deployment Inspect deployment September 9, 2025 2:56 AM

Learn more about Hydrogen's GitHub integration.

Copy link
Contributor

@jgodson jgodson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@juanpprieto juanpprieto merged commit 4bcfd72 into main Sep 9, 2025
14 checks passed
@juanpprieto juanpprieto deleted the add-eslint-promise-rules branch September 9, 2025 15:39
This was referenced Sep 11, 2025
juanpprieto pushed a commit that referenced this pull request Sep 17, 2025
#3146)

Added @typescript-eslint/no-floating-promises and @typescript-eslint/no-misused-promises
rules to both the root eslint config and skeleton template. These rules help prevent
"The script will never generate a response" errors when deploying to Oxygen/Cloudflare
Workers by ensuring promises are properly handled.

Reference: https://developers.cloudflare.com/workers/observability/errors/#the-script-will-never-generate-a-response-errors
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.

4 participants