Skip to content

[FEATURE] Add some wrangler.jsonc validation #1108

@dario-piotrowicz

Description

@dario-piotrowicz

Is your feature request related to a problem?

There are various configurations needed in an open-next wrangler.jsonc's configuration: https://opennext.js.org/cloudflare/get-started#3-create-a-wrangler-configuration-file

It's easy to miss some of them, for example I've missed the WORKER_SELF_REFERENCE in a project (see: nodejs/nodejs.org#8589) and it wasn't immediately apparent that that was the issue.

Describe the solution you'd like

The open-next config file is validated for the Cloudflare adapter using this function:

export function ensureCloudflareConfig(config: OpenNextConfig) {

It would be valuable to also add some analogous functionality for the wrangler.jsonc file to ensure that the wrangler configuration is valid.

Describe alternatives you've considered

Runtime checks could also be put in place to ensure that the worker is properly configured. But most likely having an upfront config validation is more robust and secure for users.

@opennextjs/cloudflare version

1.16.2

Additional context

No response

Before submitting

  • I have checked that there isn't already a similar feature request
  • This is a single feature (not multiple features in one request)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions