RelayModernStore.check
/Users/vidy/www/acme-admin-ui1/node_modules/relay-runtime/lib/store/RelayModernStore.js:133:55
RelayModernEnvironment._checkSelectorAndHandleMissingFields
/Users/vidy/www/acme-admin-ui1/node_modules/relay-runtime/lib/store/RelayModernEnvironment.js:229:30
RelayModernEnvironment.check
/Users/vidy/www/acme-admin-ui1/node_modules/relay-runtime/lib/store/RelayModernEnvironment.js:175:17
QueryResourceImpl._fetchAndSaveQuery
/Users/vidy/www/acme-admin-ui1/node_modules/react-relay/lib/relay-experimental/QueryResource.js:308:36
QueryResourceImpl.prepare
/Users/vidy/www/acme-admin-ui1/node_modules/react-relay/lib/relay-experimental/QueryResource.js:227:25
(anonymous function)
/Users/vidy/www/acme-admin-ui1/node_modules/react-relay/lib/relay-experimental/useLazyLoadQueryNode.js:52:26
wrapPrepareQueryResource
/Users/vidy/www/acme-admin-ui1/node_modules/react-relay/lib/relay-experimental/ProfilerContext.js:20:12
useLazyLoadQueryNode
/Users/vidy/www/acme-admin-ui1/node_modules/react-relay/lib/relay-experimental/useLazyLoadQueryNode.js:51:45
useLazyLoadQuery
/Users/vidy/www/acme-admin-ui1/node_modules/react-relay/lib/relay-experimental/useLazyLoadQuery.js:19:14
module.exports../src/layouts/BasicLayout.tsx.__webpack_exports__.default
./src/layouts/BasicLayout.tsx:119
116 | };
117 |
118 | export default ({ children }) => {
> 119 | const menu = useLazyLoadQuery<BasicLayoutQuery>(
120 | graphql`
121 | query BasicLayoutQuery {
122 | applicationMenu
lib/store/RelayModernStore.js
check = function check(operation, options) {
var _this = this;
var _this$_optimisticSour2, _ref5, _ref6;
var selector = operation.root;
var source = (_this$_optimisticSour2 = this._optimisticSource) !== null && _this$_optimisticSour2 !== void 0 ? _this$_optimisticSour2 : this._recordSource;
var globalInvalidationEpoch = this._globalInvalidationEpoch;
console.log(operation); // an object as blow without key `request`
var rootEntry = this._roots.get(operation.request.identifier);
//...
}
{
dataID: 'client:root',
node: {
kind: 'Operation',
name: 'BasicLayoutQuery',
argumentDefinitions: [],
selections: [ [Object] ]
},
variables: {}
}
"react-relay": "^8.0.0",
"relay-compiler": "^8.0.0",
"relay-config": "^8.0.0",
This is a problem with esm, csm format of generated files
Typescript plugin needs to be upgraded to fix this
@sibelius , hi, the bundled QueryResource of v8 is not correct, this line var hasFullQuery = environment.check(operation.root) is supposed to be ar hasFullQuery = environment.check(operation).
/react-relay/lib/relay-experimental/QueryResource.js
_proto._fetchAndSaveQuery = function _fetchAndSaveQuery(cacheKey, operation, fetchObservable, fetchPolicy, renderPolicy, observer) {
var _this2 = this;
var environment = this._environment; // NOTE: Running `check` will write missing data to the store using any
// missing data handlers specified on the environment;
// We run it here first to make the handlers get a chance to populate
// missing data.
var hasFullQuery = environment.check(operation.root);
var canPartialRender = hasFullQuery || renderPolicy === 'partial';
var shouldFetch;
var shouldAllowRender;
//....
}
@sibelius the hooks part of react-relay v8.0.0 on npm is on a1a40b68, which lacks 39363fedcfe408be8d3750393227126d099a9b5c
This api difference in this two version causes the runtime error
can you try these versions?
The experimental version of react-relay works well with relay-runtime 8.0.0, thanks
add react-relay@experimental and [email protected] on your package to fix it
Most helpful comment
add react-relay@experimental and [email protected] on your package to fix it