You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm encountering an issue that is probably related to: #728
I'm not sure if this related to grpc-web, but wanted to make sure that the use case is supported. I'm trying to create a server that interacts with another server via grpc-web.
Here's my code:
import express, { Express, Request, Response } from 'express';
import dotenv from 'dotenv';
import * as gauth from 'google-auth-library';
import { MyServiceClient } from '../../src/ui/client/src/proto/my_pb_service';
import * as pb from '../../src/ui/client/src/proto/my_pb';
import { Observable } from 'rxjs';
dotenv.config();
const app: Express = express();
const port = process.env.PORT;
app.get('/', (req: Request, res: Response) => {
var empty: string[];
empty = [];
res.send('Express + TypeScript Server');
console.log("creating client")
let r = new pb.CollectAndScanRequest();
r.setResourceGroupNamesList(empty);
var client = new MyServiceClient('https://my-dev.backend.url/api')
console.log("client created")
client.collectAndScan(r, (err, res) => {
if (err !== null) {
console.error(`collectAndScanAll: ${err}`);
}
if (res === null) {
console.error(`collectAndScanAll: unexpected null response`);
}
console.log(`collectAndScanAll: ${res}`);
});
console.log("Done")
});
app.listen(port, () => {
console.log(`⚡️[server]: Server is running at https://localhost:${port}`);
});
Here's the error I see:
creating client
client created
ReferenceError: self is not defined
at new e (REDACTED/src/ui/client/node_modules/@improbable-eng/grpc-web/dist/grpc-web-client.js:1:16017)
at REDACTED/src/ui/client/node_modules/@improbable-eng/grpc-web/dist/grpc-web-client.js:1:15931
at REDACTED/src/ui/client/node_modules/@improbable-eng/grpc-web/dist/grpc-web-client.js:1:15942
at o (REDACTED/src/ui/client/node_modules/@improbable-eng/grpc-web/dist/grpc-web-client.js:1:15312)
at t.makeDefaultTransport (REDACTED/src/ui/client/node_modules/@improbable-eng/grpc-web/dist/grpc-web-client.js:1:15405)
at e.createTransport (REDACTED/src/ui/client/node_modules/@improbable-eng/grpc-web/dist/grpc-web-client.js:1:8356)
at new e (REDACTED/src/ui/client/node_modules/@improbable-eng/grpc-web/dist/grpc-web-client.js:1:7911)
at t.client (REDACTED/src/ui/client/node_modules/@improbable-eng/grpc-web/dist/grpc-web-client.js:1:7619)
at t.unary (REDACTED/src/ui/client/node_modules/@improbable-eng/grpc-web/dist/grpc-web-client.js:1:24075)
at MyServiceClient.collectAndScan (REDACTED/src/ui/client/src/proto/my_pb_service.js:60:21)
Now, I'm new to TS/JS so this error and trace log is not really helpful for me. It could also be related to instantiating the grpc client, but then, I copied this from a working webfrontend code.
Does grpc-web support non browser invocation? Could this be related to webpack config?
Given there is a PR for something similar, how/where would I need to define self?
The text was updated successfully, but these errors were encountered:
self is not defined
ReferenceError: self is not defined
at new e (E:\StabilityAi\node_modules@improbable-eng\grpc-web\dist\grpc-web-client.js:1:16017)
at E:\StabilityAi\node_modules@improbable-eng\grpc-web\dist\grpc-web-client.js:1:15931
at E:\StabilityAi\node_modules@improbable-eng\grpc-web\dist\grpc-web-client.js:1:15942
at o (E:\StabilityAi\node_modules@improbable-eng\grpc-web\dist\grpc-web-client.js:1:15312)
at t.makeDefaultTransport (E:\StabilityAi\node_modules@improbable-eng\grpc-web\dist\grpc-web-client.js:1:15405)
at e.createTransport (E:\StabilityAi\node_modules@improbable-eng\grpc-web\dist\grpc-web-client.js:1:8356)
at new e (E:\StabilityAi\node_modules@improbable-eng\grpc-web\dist\grpc-web-client.js:1:7911)
at t.client (E:\StabilityAi\node_modules@improbable-eng\grpc-web\dist\grpc-web-client.js:1:7619)
at t.invoke (E:\StabilityAi\node_modules@improbable-eng\grpc-web\dist\grpc-web-client.js:1:14630)
at GenerationServiceClient.generate (E:\StabilityAi\api-interfaces-main\gooseai\generation\generation_pb_service.js:44:21)
Hi!
I'm encountering an issue that is probably related to: #728
I'm not sure if this related to grpc-web, but wanted to make sure that the use case is supported. I'm trying to create a server that interacts with another server via grpc-web.
Here's my code:
Here's the error I see:
Now, I'm new to TS/JS so this error and trace log is not really helpful for me. It could also be related to instantiating the grpc client, but then, I copied this from a working webfrontend code.
Does grpc-web support non browser invocation? Could this be related to webpack config?
Given there is a PR for something similar, how/where would I need to define
self
?The text was updated successfully, but these errors were encountered: