Crash when importing Google Cloud Speech to Text
See original GitHub issueDescribe the bug
I tried importing @google-cloud/speech, but running yarn electron:serve will eventually result in a crash.
To Reproduce
vue create vue-electron-test
cd vue-electron-test
vue add electron-builder (choose the latest Electron - 6, at the time of writing the post)
yarn add @google-cloud/speech
Add to background.js:
import speech from "@google-cloud/speech";
const client = new speech.SpeechClient({keyFilename: "credentials.json"});
Then, run:
yarn electron:serve
Expected behavior
I expect the line of const client = new speech.SpeechClient({keyFilename: "credentials.json"}); to work normally, i.e. to initialize the SpeehClient() instance while using the credentials in credentials.json
Screenshots

Environment (please complete the following information):
- OS and version: Windows 10 Pro 1903 build 18362.3356
- node version: 10.16.3
- npm version: 6.9.0
- yarn version: 1.17.3
- vue-cli-plugin-electron-builder version : ^1.4.0
- electron version: 6.0.9
- other vue plugins used: Nothing
- custom config for vcp-electron-builder: Nothing
- (if possible) link to your repo: No repo, but no need for it - just follow the steps to reproduce.
Additional context
The project itself is under C:\repositories\speech-to-text-test
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Electron program crashes when trying to import Google Cloud ...
App threw an error during load Error: error reading first path in the walk C:\Repositories\protos Error: ENOENT: no such file or directory, ...
Read more >Troubleshooting | Cloud Speech-to-Text Documentation
Learn about troubleshooting steps that you might find helpful if you run into problems using Speech-to-Text. Cannot authenticate to Speech-to-Text.
Read more >Callin google Speech to Text API from Flask Celery is ...
Trying to run the google speech to text from celery , but worker thread is crashing. Below is the code that is being...
Read more >Speech Recognition with Python Crash Course | Rubik's Code
... Python supports many speech recognition engines and APIs including Google Speech Engine, Microsoft Bing Voice Recognition, Google Cloud ...
Read more >@google-cloud/speech | Yarn - Package Manager
Bug Fixes · better support for fallback mode (#918 (7cf922a) · change import long to require (#920 (375a9b0) · deps: do not depend...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Try marking
@google-cloud/speechas an external by setting yourvue.config.jsto:Oh, I’d like to mention that in order to get it to work, the parameter
--typemust have the valueraw, i.e. make sure that in the SoX’s arguments list, there’s"--type", "raw",Plus, I discovered that I do need to add thenode-record-lpcm16topluginOptions.electronBuilder.externalsinvue.config.jsOther than that, it works flawlessly!