question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

compiler.relay must NOT have additional properties

See original GitHub issue

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:37 PDT 2022; root:xnu-8020.121.3~4/RELEASE_ARM64_T6000
Binaries:
  Node: 16.15.0
  npm: 8.5.5
  Yarn: 3.2.0
  pnpm: N/A
Relevant packages:
  next: 12.2.4-canary.0
  eslint-config-next: 12.1.6
  react: 0.0.0-experimental-c1f5884ff-20220705
  react-dom: 0.0.0-experimental-c1f5884ff-20220705

What browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

Describe the Bug

This bug happens in the last canary, a week ago it was ok. The compiler works, that means that the values passed are properly arriving to the compiler, but we have a bunch of disturbing warning messages.

This config for a relay project warns:

module.exports = {
// ..
  compiler: {
    relay: {
      // THIS 3 ARE OK
      src: 'scenes',
      schema: 'schema/server.graphql',
      language: 'flow',

      // ANYTHING ELSE WARNS      
      customScalars: {
        DateTime: 'string',
        Upload: 'File',
      },
    }
  }
warn  - Invalid next.config.js options detected: 
[
  {
    "instancePath": "/compiler/relay",
    "schemaPath": "#/properties/compiler/properties/relay/additionalProperties",
    "keyword": "additionalProperties",
    "params": {
      "additionalProperty": "schema"
    },
    "message": "must NOT have additional properties"
  },
  {
    "instancePath": "/compiler/relay",
    "schemaPath": "#/properties/compiler/properties/relay/additionalProperties",
    "keyword": "additionalProperties",
    "params": {
      "additionalProperty": "schemaExtensions"
    },
    "message": "must NOT have additional properties"
  },
  {
    "instancePath": "/compiler/relay",
    "schemaPath": "#/properties/compiler/properties/relay/additionalProperties",
    "keyword": "additionalProperties",
    "params": {
      "additionalProperty": "customScalars"
    },
    "message": "must NOT have additional properties"
  },
  {
    "instancePath": "/compiler/relay",
    "schemaPath": "#/properties/compiler/properties/relay/additionalProperties",
    "keyword": "additionalProperties",
    "params": {
      "additionalProperty": "noFutureProofEnums"
    },
    "message": "must NOT have additional properties"
  }
] 

Expected Behavior

Must not be warnings for needed parameters in compiler.relay.

Link to reproduction

https://stackblitz.com/edit/vercel-next-js-gjket8?file=next.config.js

To Reproduce

Start on dev and see the warnings in the console.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:3
  • Comments:15 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
ijjkcommented, Jul 26, 2022

@MonstraG the i18n one appears to be valid warnings as you are adding invalid config, this should be fixed in next-i18next itself.

2reactions
rikerscommented, Jul 25, 2022

Same type of warning, no problem with next@12.2.2:

[
	{
		'instancePath': '',
		'schemaPath': '#/additionalProperties',
		'keyword': 'additionalProperties',
		'params': {
			'additionalProperty': 'webpackDevMiddleware'
		},
		'message': 'must NOT have additional properties'
	},
	{
		'instancePath': '',
		'schemaPath': '#/additionalProperties',
		'keyword': 'additionalProperties',
		'params': {
			'additionalProperty': 'configOrigin'
		},
		'message': 'must NOT have additional properties'
	},
	{
		'instancePath': '',
		'schemaPath': '#/additionalProperties',
		'keyword': 'additionalProperties',
		'params': {
			'additionalProperty': 'target'
		},
		'message': 'must NOT have additional properties'
	},
	{
		'instancePath': '',
		'schemaPath': '#/additionalProperties',
		'keyword': 'additionalProperties',
		'params': {
			'additionalProperty': 'analyticsId'
		},
		'message': 'must NOT have additional properties'
	},
	{
		'instancePath': '',
		'schemaPath': '#/additionalProperties',
		'keyword': 'additionalProperties',
		'params': {
			'additionalProperty': 'webpack5'
		},
		'message': 'must NOT have additional properties'
	},
	{
		'instancePath': '/amp/canonicalBase',
		'schemaPath': '#/properties/amp/properties/canonicalBase/minLength',
		'keyword': 'minLength',
		'params': {
			'limit': 1
		},
		'message': 'must NOT have fewer than 1 characters'
	},
	{
		'instancePath': '/assetPrefix',
		'schemaPath': '#/properties/assetPrefix/minLength',
		'keyword': 'minLength',
		'params': {
			'limit': 1
		},
		'message': 'must NOT have fewer than 1 characters'
	},
	{
		'instancePath': '/basePath',
		'schemaPath': '#/properties/basePath/minLength',
		'keyword': 'minLength',
		'params': {
			'limit': 1
		},
		'message': 'must NOT have fewer than 1 characters'
	},
	{
		'instancePath': '/experimental/outputFileTracingRoot',
		'schemaPath': '#/properties/experimental/properties/outputFileTracingRoot/minLength',
		'keyword': 'minLength',
		'params': {
			'limit': 1
		},
		'message': 'must NOT have fewer than 1 characters'
	},
	{
		'instancePath': '/generateEtags',
		'schemaPath': '#/properties/generateEtags/isFunction',
		'keyword': 'isFunction',
		'params': {},
		'message': 'must pass "isFunction" keyword validation'
	},
	{
		'instancePath': '/i18n',
		'schemaPath': '#/properties/i18n/type',
		'keyword': 'type',
		'params': {
			'type': 'object'
		},
		'message': 'must be object'
	}
];
Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Schema validation failed with the following errors: Data ...
Schema validation failed with the following errors: Data path "['server']" should NOT have additional properties(scripts).
Read more >
Introducing the new Relay compiler
We've further improved the performance of the compiler since then. This post will explore why Relay has a compiler, what we hope to...
Read more >
Limitations & Troubleshooting | Android Developers
If a UI Package name does not start with a letter, Relay will generate Compose code that does not compile, with an error...
Read more >
Relay Compiler - Relay Docs
The Relay Compiler is responsible for generating code as part of a build step which, at runtime, can be used statically. By building...
Read more >
A deep-dive into Relay, the friendly & opinionated GraphQL ...
Go with a less opinionated, more flexible GraphQL client like Apollo. Anatomy of Relay. Colocation. Fragments; Data masking. Relay compiler.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found