diff --git a/website/docs/guides/troubleshooting.mdx b/website/docs/guides/troubleshooting.mdx index 29f2427c..47a6b562 100644 --- a/website/docs/guides/troubleshooting.mdx +++ b/website/docs/guides/troubleshooting.mdx @@ -24,4 +24,34 @@ If your built application looks like this in finder: it's likely that your application's `info.plist` is invalid. Update the file in `build/.app/Contents/info.plist` and check if the data is valid, EG check the binary name is correct. To persist the changes, copy the file back to -the `build/darwin` directory. \ No newline at end of file +the `build/darwin` directory. + +## Cannot call backend method from frontend with variadic arguments + +If you have a backend method defined with variadic parameters, eg: +```go +func (a *App) TestFunc(msg string, args ...interface{}) error { + // Code +} +``` +calling this method from the frontend like this will fail: +```js +var msg = "Hello: " +var args = ["Go", "JS"] +window.go.main.App.TestFunc(msg, ...args).then((result) => { + //do things here +}).catch((error) => { + //handle error +}); +``` +Workaround: +```js +var msg = "Hello " +var args = ["Go", "JS"] +window.go.main.App.TestFunc(msg, args).then((result) => { //without the 3 dots + //do things here +}).catch((error) => { + //handle error +}); +``` +Credit: https://github.com/wailsapp/wails/issues/1186 \ No newline at end of file