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.

Multiple targets not working via Programmatic API

See original GitHub issue
  • Version: 18.6.2
  • Target: osx, windows, linux (tried variations of arch and target types, thats not the issue here)

The programmatic API docs shows an example with:

builder.build({
  targets: Platform.MAC.createTarget(),
  config: {
   "//": "build options, see https://goo.gl/ZhRfla"
  }
})

And it works perfectly fine for a single platform build, same for Linux and Windows. However, whenever I try passing multiple targets, e.g.:

targets: [Platform.WINDOWS.createTarget('squirrel', Arch.ia32), Platform.LINUX.createTarget('appimage', Arch.ia32), Platform.MAC.createTarget()]

It throws an error:

electron-builder 18.6.2
[14:40:00] Error: Unknown platform: windows,[object Map]
    at Packager.createHelper (/Users/paulius/Code/timer-app/node_modules/electron-builder/src/packager.ts:319:15)

Am I doing something wrong here or are multiple targets just not supported?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ripexzcommented, Jun 13, 2017

Also it seems to override the config, for example it built a Mac version with .dmg, .zip and yml update file… whereas in the config I am targeting mas and normally just passing targets: Platform.MAC.createTarget() would create a MAS build as expected.

I changed mac: ["default"] to mac: ["mas"] and it’s building MAS versions now

Yes, squirrel is a correct target name, fixed.

Yep, that seems to work now

Better to build x64 AppImage 😃

Ran without errors, but what about the poor 32-bit users? 😄

0reactions
bnkucommented, Feb 16, 2022

My solution:

const config = { ... };
const targets = new Map()
    .set(Platform.LINUX, new Map())
    .set(Platform.WINDOWS, new Map());
    .set(Platform.MAC, new Map());

builder.build({
    targets,
    config,
})
Read more comments on GitHub >

github_iconTop Results From Across the Web

Add Targets to Blackbox Exporter programmatically via API ...
I couldn't find a programmatic way to manage targets so I'm add just editing the text and manually reloading the config via curl....
Read more >
Detect and Track Multiple Targets Simultaneously - Vuforia
Vuforia allows you to track multiple targets simultaneously. This enables interactions between targets as two or more targets are detected while in the...
Read more >
What is an Application Programming Interface (API)? - IBM
Application programming interfaces, or APIs, simplify software development by enabling applications to exchange data and functionality easily and more ...
Read more >
Behavior changes: Apps targeting Android 13 or higher
Learn about changes in Android 13 that will affect apps when they target Android 13 or higher.
Read more >
Common Configuration - electron-builder
ico (if several extensions specified, first is used) or to application icon. Not supported on Linux, file issue if need (default icon will...
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