relay-compiler does not recognize diagnosticReportConfig in package.json:relay configuration
- Dominant language
- Rust
- Stars
- 19k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
# relay-compiler does not recognize diagnosticReportConfig in package.json:relay configuration
## Environment
* relay-compiler v14.1.0
## Reproduction Steps
* Navigate to
* In the `package.json`:
* Add `"relay-compiler": "14.1.0"` to `devDependencies` block
* Add `"relay": "relay-compiler"` to `scripts` block
* Add a new block for relay:
```json
"relay": {
"diagnosticReportConfig": {
"criticalLevel": "warning"
}
}
```
* Run `npm run relay` in terminal
* Observe the error message:
```
$ npm run relay
> relay-starter-kit@0.1.0 relay /app
> relay-compiler
[ERROR] Unable to initialize relay compiler configuration. Error details:
Error searching config: Invalid config file: "/app/package.json": Found key `relay` in package.json, but failed incorrect value: The config file cannot be parsed as a multi-project config file due to:
- Error("unknown field `diagnosticReportConfig`, expected one of `name`, `root`, `header`, `codegenCommand`, `sources`, `excludes`, `projects`, `featureFlags`, `savedStateConfig`, `isDevVariableName`", line: 0, column: 0).
It also cannot be a single project config file due to:
- Error("unknown field `diagnosticReportConfig`, expected one of `schema`, `src`, `artifactDirectory`, `include`, `extensions`, `excludes`, `schemaExtensions`, `noFutureProofEnums`, `language`, `customScalars`, `eagerEsModules`, `persistConfig`, `isDevVariableName`, `codegenCommand`, `jsModuleFormat`, `schemaConfig`, `moduleImportConfig`, `typegenPhase`, `featureFlags`", line: 0, column: 0).
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! relay-starter-kit@0.1.0 relay: `relay-compiler`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the relay-starter-kit@0.1.0 relay script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npm-cache/10.24.1/_logs/2022-11-15T21_14_33_991Z-debug.log
```
## What I expected
I would expect the compiler to run with errors being displayed as warnings.
## What actually happens
It would seem that the compiler is unaware of the documented configuration option and throws an error message with the list of acceptable options it knows of. The official [README](https://github.com/facebook/relay/tree/main/packages/relay-compiler) for the compiler shows this to be a valid option.
Contributor guide
Assessment
This issue has not been assessed yet.