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

Cannot specify null for publishDirJSONFileName #18

Closed
mattstratton opened this issue May 30, 2020 · 4 comments
Closed

Cannot specify null for publishDirJSONFileName #18

mattstratton opened this issue May 30, 2020 · 4 comments

Comments

@mattstratton
Copy link

Describe the bug
I am trying to use the plugin to only create the serverless function. However, Netlify doesn't seem to like null as a parameter.

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.
@swyxio
Copy link
Owner

swyxio commented May 31, 2020

thats probably something to do with Netlify Build's validator. @ehmicky @erquhart do you want to take this on in the netlify-build repo pls? i dont think this one comes from my end.

@swyxio
Copy link
Owner

swyxio commented May 31, 2020

went ahead and made one, thanks for the report netlify/build#1402

@swyxio swyxio closed this as completed May 31, 2020
@ehmicky
Copy link
Collaborator

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
}

@swyxio
Copy link
Owner

swyxio commented Jun 1, 2020

interesting. i'm not fluent in the spec but maybe worth improving that error message with links to source for users

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants