Skip to content

Cannot deploy react-router with future unstable_middleware=true #13327

@FinPlorer

Description

@FinPlorer

Settings

export default {
    ssr: true,
    presets: [vercelPreset()],
    future: {
        unstable_middleware: true
    }
}

throw this error on each run :

Error: Unable to create initial unstable_RouterContextProvider instance. Please confirm you are returning an instance of Map<unstable_routerContext, unknown> from your getLoadContext function.

Error: TypeError: init is not iterable
at Object.requestHandler [as handlerWeb] (/var/task/node_modules/react-router/dist/development/index.js:10954:23)
at Object.handler (/opt/rust/nodejs.js:2:14544)
at Server. (/opt/rust/nodejs.js:2:1716)
at /opt/rust/nodejs.js:16:6302
at AsyncLocalStorage.run (node:internal/async_local_storage/async_hooks:91:14)
at /opt/rust/nodejs.js:16:6290
at AsyncLocalStorage.run (node:internal/async_local_storage/async_hooks:91:14)
at Server. (/opt/rust/nodejs.js:16:6278)
at Server.s (/opt/rust/nodejs.js:16:1040)
at Server.emit (node:events:518:28)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions