Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type is not assignable to type ServerBuild with exactOptionalPropertyTypes: true #5466

Closed
1 task done
aaronadamsCA opened this issue Feb 15, 2023 · 3 comments
Closed
1 task done

Comments

@aaronadamsCA
Copy link
Contributor

What version of Remix are you using?

1.12.0

Are all your remix dependencies & dev-dependencies using the same version?

  • Yes

Steps to Reproduce

server.ts

import type { RequestHandler } from "@remix-run/cloudflare-pages";
import { createPagesFunctionHandler } from "@remix-run/cloudflare-pages";
import * as build from "@remix-run/dev/server-build";

export const onRequest: RequestHandler = createPagesFunctionHandler({
  build,
  getLoadContext: (context) => context,
  mode: process.env["NODE_ENV"] ?? "production",
});

Expected Behavior

Works normally.

Actual Behavior

Type 'typeof import("node_modules/@remix-run/dev/server-build")' is not assignable to type 'ServerBuild' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
  Types of property 'dev' are incompatible.
    Type '{ liveReloadPort: number; } | undefined' is not assignable to type '{ liveReloadPort: number; }'.
      Type 'undefined' is not assignable to type '{ liveReloadPort: number; }'. ts(2375)

worker.d.ts(13, 5): The expected type comes from property 'build' which is declared here on type 'createPagesFunctionHandlerParams<any>'

This type mismatch was introduced in #5133, I can submit a PR now.

@github-actions
Copy link
Contributor

This issue has been automatically marked stale because we haven't received a response from the original author in a while 🙈. This automation helps keep the issue tracker clean from issues that are not actionable. Please reach out if you have more information for us or you think this issue shouldn't be closed! 🙂 If you don't do so within 7 days, this issue will be automatically closed.

@github-actions github-actions bot added the needs-response We need a response from the original author about this issue/PR label Apr 17, 2023
@aaronadamsCA
Copy link
Contributor Author

Not stale, PR in review.

@github-actions github-actions bot removed the needs-response We need a response from the original author about this issue/PR label Apr 19, 2023
@pcattori
Copy link
Contributor

pcattori commented Jul 5, 2023

#6724 removed the need to pass dev-only fields in ServerBuild, so that should address this too.

@pcattori pcattori closed this as completed Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants