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

Invalid configuration object for snap #6327

Closed
lutzroeder opened this issue Oct 10, 2021 · 4 comments · Fixed by #6333
Closed

Invalid configuration object for snap #6327

lutzroeder opened this issue Oct 10, 2021 · 4 comments · Fixed by #6333

Comments

@lutzroeder
Copy link
Contributor

lutzroeder commented Oct 10, 2021

  • Electron-Builder Version: 22.13.1
  • Node Version: 16.11.0
  • Electron Version: 15.1.2
  • Target: snapStore
~/Projects/example: npx electron-builder --linux snap --x64 --publish never
  • electron-builder  version=22.13.1 os=20.6.0
  • loaded configuration  file=/Users/username/Projects/example/electron-builder.yml
  ⨯ Invalid configuration object. electron-builder 22.13.1 has been initialized using a configuration object that does not match the API schema.
 - configuration.snap should be one of these:
   object { after?, appPartStage?, artifactName?, assumes?, autoStart?, buildPackages?, category?, confinement?, description?, desktop?, environment?, executableArgs?, grade?, hooks?, layout?, mimeTypes?, plugs?, publish?, slots?, stagePackages?, summary?, synopsis?, title?, useTemplateApp? } | null
   -> Snap options.
   Details:
    * configuration.snap.publish[0].provider should be "github".
      -> The provider. Must be `github`.
    * configuration.snap.publish[0].provider should be "s3".
      -> The provider. Must be `s3`.
    * configuration.snap.publish[0].provider should be "spaces".
      -> The provider. Must be `spaces`.
    * configuration.snap.publish[0].provider should be "generic".
      -> The provider. Must be `generic`.
    * configuration.snap.publish[0].provider should be "bintray".
      -> The provider. Must be `bintray`.
    * configuration.snap.publish[0].provider should be "custom".
      -> The provider. Must be `custom`.
    * configuration.snap.publish[0].provider should be "keygen".
      -> The provider. Must be `keygen`.
     How to fix:
     1. Open https://www.electron.build/configuration/snap
     2. Search the option name on the page (or type in into Search to find across the docs).
       * Not found? The option was deprecated or not exists (check spelling).
       * Found? Check that the option in the appropriate place. e.g. "title" only in the "dmg", not in the root.
  failedTask=build stackTrace=ValidationError: Invalid configuration object. electron-builder 22.13.1 has been initialized using a configuration object that does not match the API schema.
 - configuration.snap should be one of these:
   object { after?, appPartStage?, artifactName?, assumes?, autoStart?, buildPackages?, category?, confinement?, description?, desktop?, environment?, executableArgs?, grade?, hooks?, layout?, mimeTypes?, plugs?, publish?, slots?, stagePackages?, summary?, synopsis?, title?, useTemplateApp? } | null
   -> Snap options.
   Details:
    * configuration.snap.publish[0].provider should be "github".
      -> The provider. Must be `github`.
    * configuration.snap.publish[0].provider should be "s3".
      -> The provider. Must be `s3`.
    * configuration.snap.publish[0].provider should be "spaces".
      -> The provider. Must be `spaces`.
    * configuration.snap.publish[0].provider should be "generic".
      -> The provider. Must be `generic`.
    * configuration.snap.publish[0].provider should be "bintray".
      -> The provider. Must be `bintray`.
    * configuration.snap.publish[0].provider should be "custom".
      -> The provider. Must be `custom`.
    * configuration.snap.publish[0].provider should be "keygen".
      -> The provider. Must be `keygen`.
     How to fix:
     1. Open https://www.electron.build/configuration/snap
     2. Search the option name on the page (or type in into Search to find across the docs).
       * Not found? The option was deprecated or not exists (check spelling).
       * Found? Check that the option in the appropriate place. e.g. "title" only in the "dmg", not in the root.
    at Object.validateConfig (/Users/username/Projects/example/node_modules/app-builder-lib/src/util/config.ts:240:3)
    at Packager._build (/Users/username/Projects/example/node_modules/app-builder-lib/src/packager.ts:342:5)
    at Packager.build (/Users/username/Projects/example/node_modules/app-builder-lib/src/packager.ts:337:12)
    at Object.executeFinally (/Users/username/Projects/example/node_modules/builder-util/src/promise.ts:12:14)

electron-builder.yml

snap:
  plugs:
  - default
  - removable-media
  publish:
  - provider: snapStore
    channels:
    - stable

@mmaietta #6193 @mhatvan #6190

@mmaietta
Copy link
Collaborator

Was it previously working?
I didn't test for publish nested within snap config

@mcmxcdev
Copy link
Contributor

No clue, but would be great to support extending the default plugs like it is mentioned in the docs!

@lutzroeder
Copy link
Contributor Author

lutzroeder commented Oct 12, 2021

@mmaietta repro attached. Run npm install followed by npm run snap. Works for v22.11.7 and fails in v22.13.1.

electron-builder-6327.zip

Looking at this commit schema.json should constraint based on channels instead of repo?

@KarthikeyanMahadeva
Copy link

bjnlklk

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

Successfully merging a pull request may close this issue.

4 participants