#tauri-action fails with JSON-error

29 messages · Page 1 of 1 (latest)

cunning parrot
#

Hi, it fails with a JSON-error, but I am having difficult finding exactly what fails.
This is the output. Any ideas?

src-tauri/tauri.signed.conf.json

{
  "tauri": {
    "bundle": {
      "windows": {
        "certificateThumbprint": "cbxxxxxxxxxxxxxxxxxxxxxxxxx",
        "digestAlgorithm": "sha256",
        "timestampUrl": "http://timestamp.sectigo.com"
      }
    }
  }
}

src-tauri/tauri.conf.json

{
  "package": {
    "productName": "Xxxxxx",
    "version": "../package.json"
  },
  "build": {
    "distDir": "../build",
    "devPath": "http://localhost:3000",
    "beforeDevCommand": "pnpm cross-env BROWSER=none craco start",
    "beforeBuildCommand": "pnpm build"
  },
  "tauri": {
    "macOSPrivateApi": true,
    "bundle": {
      "active": true,
      "targets": "all",
      "identifier": "xe.xxxxxx.xxxxxxx",
      "icon": ["icons/[email protected]", "icons/128x128.png", "icons/32x32.png", "icons/icon.icns", "icons/icon.ico"],
      "resources": [],
      "externalBin": [],
      "category": "public.app-category.utilities",
      "deb": {
        "depends": []
      },
      "macOS": {
        "frameworks": [],
        "exceptionDomain": "",
        "signingIdentity": null,
        "providerShortName": null,
        "entitlements": "Info.plist"
      },
      "windows": {
        "wix": {
          "bannerPath": "../installer/windows/banner.png",
          "dialogImagePath": "../installer/windows/dialog.png"
        }
      }
    },
    "updater": {
      "active": false
    },
    "allowlist": {
      "all": true
    },
    "windows": [
      {
        "title": "XXxxxxxx",
        "label": "main",
        "minWidth": 220,
        "minHeight": 90,
        "width": 220,
        "height": 90,
        "resizable": true,
        "decorations": true,
        "alwaysOnTop": true,
        "transparent": false,
        "skipTaskbar": false,
        "visible": true
      }
    ],
    "security": {}
  }
}
jolly birch
#

Does it build successfully on a local device? Other than that, the only place I see that the invalid JSON could come from is the ../package.json file. Does that have a . at the start of it?

cunning parrot
#

Yes, it builds successfully on local computer 😦
Nope, package.json looks fine 😦

#

I'm guessing I can printout package.json in the step before, know of any other json files that are used at this step?

jolly birch
#

There's a lot of JSON files referenced by tauri-action. How long does it take to fail?

cunning parrot
#

Right away, 0 seconds

jolly birch
#

So it's not something it's downloading, it's definitely a file it has to read... are you sure you're meant to be reading tauri.signed.conf.json and not tauri.json?

pallid otter
pallid otter
cunning parrot
#

I'm aware of the platform specific configuration which works the same as me using the --config

  -c, --config <CONFIG>
          JSON string or path to JSON file to merge with tauri.conf.json

It's not something that solves what I'm trying to do (unsigned bundles on windows dev machines)

I don't see how my configs combined could result in a json-file starting with a .

jolly birch
#

How do you combine the configs?

cunning parrot
#

It's visible (and pointed at) in my screenshot of the tauri-action
args: --verbose --config ./src-tauri/tauri.signed.conf.json

jolly birch
#

That's only one file. What do you do with the other file?

cunning parrot
#

From tauri build --help

  -c, --config <CONFIG>
          JSON string or path to JSON file to merge with tauri.conf.json
#

"to merge with tauri.conf.json"

jolly birch
#

Is tauri.json just a typo and the file is actually called tauri.conf.json?

cunning parrot
#

Oh, right, yes, only typo in my presentation of my problem, will fix

jolly birch
#

The only other idea I had was it might be "category": "public.app-category.utilities" but you said it builds locally without an issue so it can't be that. I don't use GitHub Actions and there hasn't been a flood of new issues so this might be quite difficult to track down. Does it behave the same if you change the contents of tauri.signed.conf.json to change something simple like a single letter in the identifier?

cunning parrot
#

I just realized that I have tested it locally somewhat stupidly. I'm using Linux, it might give me more clues if I try to build it in Windows since it's Windows-config I overload

The category is a mac-config, so it feels like it's unrelated

#

Yeah, thanks for your help. I can probably solve this in another way if I need to. I was hoping for a "Oh, yeah, it must be that you have XXXX" answer 😄

#

I'll do some more painfull github action debugging

cunning parrot
#

Found the issue
You can't specify it like this: args: --verbose --config ./src-tauri/tauri.signed.conf.json
It needs to be like this: args: --verbose --config=./src-tauri/tauri.signed.conf.json

jolly birch
#

Hm... must be a GitHub Actions thing.

cunning parrot
#

Yeah, I think so too

cunning parrot
#

Probably verifiable if one exchanges my ./src-tauri with # and if it complains on a JSON error with # on index 0 😛

jolly birch
#

Oh... that must be how it determines if it's a file or JSON. I figured it would try for JSON first, obviously fail, then try it as a file input. Seems less error-prone?

echo palm
#

so i ran into this as well and i found it to work if i just took away the ./

--config src-tauri/tauri.conf.json

long lake
#

that has to be the tauri cli failing though and not the action itself, right?
The action tries to parse the config as a json string first but ignores all errors, then proceeds to try it as a file path, so what icb said/expected.

#

Orrrr does the action runner panic if we use console.error to log stuff 🤔