After converting a Web Extension using safari-web-extension-converter, running extension fails with SFErrorDomain code 1

I have a web extension https://github.com/david-shortman/clickster

In the directory for that extension, I ran
Code Block
david@Davids-Mac-mini clickster % xcrun safari-web-extension-converter .
Xcode Project Location: /Volumes/Samsung_T5/dev/GitHub/clickster
App Name: Clickster
App Bundle Identifier: com.yourCompany.Clickster
Language: Swift
Is this correct? [yes]: no
Xcode Project Location [/Volumes/Samsung_T5/dev/GitHub/clickster]:
App Name [Clickster]:
App Bundle Identifier [com.yourCompany.Clickster]: com.shortman.Clickster
1. Swift
2. Objective-C
Language [1]: 1


Then, Xcode automatically opens that project.

I ran the app with the default config for "My Mac".

The extension immediately encountered this error in the default guard in ViewController here

error
Code Block
error Error? domain: "SFErrorDomain" - code: 1 0x0000600002706ca0


error was thrown on line 3
Code Block
guard let state = state, error == nil else {
                // Insert code to inform the user that something went wrong.
                return // <- breaks here
            }

Accepted Reply

I was able to solve the problem by doing a clean install of macOS and Xcode. What a dumb as hell problem. No idea what the cause was.

I did try removing Xcode and relevant files/directories first, but that didn't help. Only the clean install of macOS seemed to do the trick.

Replies

I was able to solve the problem by doing a clean install of macOS and Xcode. What a dumb as hell problem. No idea what the cause was.

I did try removing Xcode and relevant files/directories first, but that didn't help. Only the clean install of macOS seemed to do the trick.
Don't need to reinstall of macOS and Xcode.

A solution for me
Code Block
PATH=/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support:"$PATH"
lsregister -f /Applications/Safari.app