ionic-team / ionic-team/capacitor-background-runner

Fetch problem on iOS 17 simulator

Open
#64 1 comment 2 reactions 0 assignees View on GitHub
Dominant language
C
Stars
56
Forks
36
Avg merge
4d 12h
Merged PRs (30d)
7

Description

I got the following error on iOS simulator:

```
CapacitorBackgroundRunner/BackgroundRunner.swift:160: Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value
```

The problematic code is this:

```
returnObj.toDictionary().forEach { key, value in. // Line 160
dict[String(describing: key)] = value
}
```

My code in the runner.js file:

```
addEventListener("fetchTest", async (resolve, reject, args) => {
try {
const res = await fetch("https://randomuser.me/api/");
console.log("res???", res);

resolve('plain text');
} catch (err) {
console.error(err);
reject(err);
}
});
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.