facebook / facebook/relay

Relay Environment type issues when upgrading to react-relay 16.x

Open
#4,657 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
19k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

tl;dr we are seeing `Type 'RelayModernEnvironment' is not assignable to type 'Environment'.` after upgrading even with code right from docs.

We are attempting to upgrade from react-relay 14.x to 16.0.0. Our dependencies are now: react-relay 16.0.0, relay-runtime 16.0.0, @types/react-relay 16.0.0, @types/relay-runtime 14.1.15, babel-plugin-relay 16.0.0, relay-compiler 16.0.0.

We are seeing `Type 'RelayModernEnvironment' is not assignable to type 'Environment'.` with all our uses of environment.

I simplified the case by copying this set up right from the [docs for RelayEnvironmentProvider here](https://relay.dev/docs/api-reference/relay-environment-provider/):

image

image

Because this is just passing in the environment directly from `new Environment(..)` as the docs show I'm not sure what the issue is with the RelayModernEnvironment vs Environment

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.