I'm trying to run Google Text-To-Speech in electron using the NodeJs Text To Speech Client Libary
I am able to use require('@google-cloud/text-to-speech'); within the main.js of my project (where the browser window is created)` but cannot run it within a script from within the page.
The error I get is the following:
Uncaught TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type object
at validateString (internal/validators.js:112:11)
at Object.basename (path.js:671:5)
at GrpcClient.loadProto (path\to\project\node_modules\google-gax\build\src\grpc.js:117:29)
at new TextToSpeechClient (path\to\project\node_modules\@google-cloud\text-to-speech\build\src\v1\text_to_speech_client.js:106:32)
at file://path/to/project/scripts/speech/ttscli.js:7:16
from this code located in scripts/speech/ttscli.js
nodeIntegration is set to true, and scripts/speech/ttscli.js is used like so:
<script src="./scripts/speech/ttscli.js"></script>
Any assistance would be greatly appreciated