Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Netlify validator errors on null #1402

Closed
swyxio opened this issue May 31, 2020 · 1 comment
Closed

Netlify validator errors on null #1402

swyxio opened this issue May 31, 2020 · 1 comment
Labels
type: bug code to address defects in shipped code

Comments

@swyxio
Copy link
Contributor

swyxio commented May 31, 2020

Describe the bug

swyxio/netlify-plugin-search-index#18

With this configuration:

[[plugins]]
  package = "netlify-plugin-search-index"
    [plugins.inputs]
    generatedFunctionName = "devopsdaysSearch"
    publishDirJSONFileName = null

The following error comes from Netlify:

10:21:00 PM: Failed during stage 'Reading and parsing configuration files': 
When resolving config file /opt/build/repo/netlify.toml:
Could not parse configuration file
Expected "'", "'''", "+", "-", "[", "\"", "\"\"\"", "_", "false", "true", "{", [ \t] or [0-9] but "n" found.

i believe the source is in netlify build's validation.

@ehmicky
Copy link
Contributor

ehmicky commented Jun 1, 2020

null is not a valid type in TOML (see toml-lang/toml#30, toml-lang/toml#146).

> require('toml').parse('test = null')
Uncaught:
[SyntaxError: Expected "'", "'''", "+", "-", "[", "\"", "\"\"\"", "_", "false", "true", "{", [ \t] or [0-9] but "n" found.] {
  expected: [
    { type: 'literal', value: "'", description: `"'"` },
    { type: 'literal', value: "'''", description: `"'''"` },
    { type: 'literal', value: '+', description: '"+"' },
    { type: 'literal', value: '-', description: '"-"' },
    { type: 'literal', value: '[', description: '"["' },
    { type: 'literal', value: '"', description: '"\\""' },
    { type: 'literal', value: '"""', description: '"\\"\\"\\""' },
    { type: 'literal', value: '_', description: '"_"' },
    { type: 'literal', value: 'false', description: '"false"' },
    { type: 'literal', value: 'true', description: '"true"' },
    { type: 'literal', value: '{', description: '"{"' },
    { type: 'class', value: '[ \\t]', description: '[ \\t]' },
    { type: 'class', value: '[0-9]', description: '[0-9]' }
  ],
  found: 'n',
  offset: 7,
  line: 1,
  column: 8
}

Instead, an empty string can be used if you would like user to override a default value.

@ehmicky ehmicky closed this as completed Jun 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug code to address defects in shipped code
Projects
None yet
Development

No branches or pull requests

2 participants