-
Notifications
You must be signed in to change notification settings - Fork 583
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failed to execute 'fetch' on 'Window': member signal is not of type AbortSignal. #3005
Comments
I built realm@v10.0.0-beta.6 from source with the following change to NetworkTransport.js lines 43-47:
which seems to do the trick. Is there any motivation to continue trying to get global fetch? |
Are you running this code from the main or a renderer process? |
Okay - I managed to reproduce the error in the renderer process, using the following project structure: package.json{
"name": "realm-js-electron-test",
"version": "0.1.0",
"private": true,
"main": "index.js",
"scripts": {
"test": "electron index.js"
},
"devDependencies": {
"electron": "^8.1.1"
},
"dependencies": {
"realm": "^10.0.0-beta.7"
}
} .npmrctarget=8.1.1
runtime=electron
disturl=https://atom.io/download/electron index.jsconst { app, BrowserWindow } = require("electron");
const Realm = require("realm");
/*
async function useRealm() {
const app = new Realm.App("realmwebtestapp-ybnna");
const credentials = Realm.Credentials.anonymous();
const user = await app.logIn(credentials);
console.log(user);
}
app.on("ready", () => {
console.log("App is ready - lets use Realm");
useRealm().then(() => {
console.log("All done ...");
}, err => {
console.error(err);
process.exit(1);
});
});
*/
app.on("ready", () => {
const window = new BrowserWindow({ webPreferences: { nodeIntegration: true } });
window.loadFile("index.html");
}); index.html<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Testing Realm JS</title>
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
</head>
<body>
<h1>Testing Realm JS</h1>
<script>
const Realm = require("realm");
async function useRealm() {
const app = new Realm.App("realmwebtestapp-ybnna");
const credentials = Realm.Credentials.anonymous();
const user = await app.logIn(credentials);
console.log(user);
}
useRealm().then(() => {
console.log("All done ...");
}, err => {
console.error(err);
process.exit(1);
});
</script>
</body>
</html> |
The PR has been merged, you can expect a fix for this in the upcoming v10 beta release. |
Hi, I'm running into issues integrating basic authentication using Realm with Electron. I believe this issue is related to Azure/azure-sdk-for-js#5143. I noticed that in realm-js, lib/NetworkTransport.js line 46 is where global fetch is being retrieved. While avoiding global fetch is the solution azure-sdk-for-js decided to pursue, is there a short-term solution I can apply to get unblocked? Thanks.
Goals
I want to enable email/password Login based on https://docs.mongodb.com/realm/tutorial/react-native/ for my Electron app.
Expected Results
Calling app.logIn(creds) on a Realm.App to return a valid user.
Actual Results
I receive the following error:
Failed to execute 'fetch' on 'Window': member signal is not of type AbortSignal.
Steps to Reproduce
Following this tutorial https://docs.mongodb.com/realm/tutorial/react-native/ with Electron.
Code Sample
Version of Realm and Tooling
The text was updated successfully, but these errors were encountered: