I am trying to get the opencv.js emscripten port running in my electron app.
I found this example of an app using opencv.js, but when I try to integrate it into my electron project it just throws some cryptic error.
When I just try to require opencv.js I am getting
Uncaught ReferenceError: Module is not defined
at opencv.js:33
at Object.<anonymous> (opencv.js:5)
Also when I include it via script tag, like outlined here.
In general I am having a really hard time finding proper documentation on how to load emscripten in electron.
Any help is greatly appreciated!
Upgraded from electron 3.1 to 5.0, now it works
Related
My goal is to develop a VS Code extension with speech recognition, ideally via google's API.
When attempting to import and use #google-cloud/speech, the following error is thrown at runtime:
Error: #grpc/grpc-js only works on Node ^8.13.0 || >=10.10.0
VS Code (as of 6/20/2019) is running electron 3.18 and node.js 10.2.0. Does this mean there is no way to work around this issue?
I'm following this tutorial: https://cloud.google.com/speech-to-text/docs/streaming-recognize
Sounds like it should work starting with the next release then. From the preliminary 1.36 release notes:
The Electron version that VS Code runs on has been updated and brings with it an update to Node.js from 10.2.0 to 10.11.0. All extensions will now run on this newer version of Node.js.
To make sure, you can try an Insider's build.
Generally speaking though, there's no way to control what Node version VSCode extension run on (see here), so I guess you got lucky here. :)
I am developing an Android App using Phonegap and trying to add the Push Notification.
I already added the plugin successfully using "phonegap plugin add phonegap-plugin-push". Config.xml was also updated and i can see the version of push plugin as 2.2.3.
Note: i created the project using the push-template. Cordova.js is also coded in index.html.
When i try to view my application on google browser. I get these errors.
Uncaught ReferenceError: module is not defined
at push.js:330
Uncaught TypeError: PushNotification.init is not a function.
I am not allowed yet to post pictures so here's the link for the section which is having an issue.
https://i.stack.imgur.com/ezw6U.png
I've been trying to fix this. Read all related problem on github and stackoverflow but to no avail.
These are the versions i'm using.
cordova 9.0.0
phonegap 8.2.2
Solved!
The browser will give you this error if you are previewing your app using the index.html from the root folder of your application.
It should be compiled first to a specific platform so you can preview the app from the compiled files. This is the path in case of Android: platforms\android\app\src\main\assets\www
I have a working node.js project with 4.5+ node.js and Q Promise. I am using netbeans to edit the project. However i am getting syntax error all over the project. How can i and from where can i add dependency/plugin in netbeans to avoid these syntax issues.
Here is a sample
Download the just released NetBeans 8.2, it has support for ES6
https://netbeans.org/downloads/
Where I am currently:
I have began working on a NodeJS native extension I intend to work with Electron, but from previous works I have noted that the build steps for building for just NodeJS are as expected, include the libraries as per instruction and change to output a .dll file with a .node extension.
The problem I am facing:
When compiling my extension, which tried and tested within NodeJS, does not work within an Electron contained instance of NodeJS - from searching around I understand this to be a problem with the header files which I am compiling against etc. The documentation for building with visual studio (not Visual Studio Code) is very sparse and everywhere generally points to using node-gyp - which is something I'm attempting to avoid and build using purely Visual Studio 2015.
For reference, when running the working (in NodeJS) NativeExtension I get the following error (which googling brought me to the conclusion I am compiling against the wrong thing):
ELECTRON_ASAR.js:167 Uncaught Error: Module did not self-register.
Could someone please shed some light on where I may be going wrong? I am a novice when it comes to C++ program structure and compiling methodologies.
The documentation for building with visual studio (not Visual Studio Code) is very sparse and everywhere generally points to using node-gyp - which is something I'm attempting to avoid and build using purely Visual Studio 2015.
There is a standard way of compiling native Node modules, and as a self admitted novice it would be unwise to deviate from it. I suggest you read through the Microsoft NodeJS guidelines and get your development environment properly configured to build via node-gyp, once that's working you can start figuring out how to rebuild native Node modules for Electron.
I do most of my work in python but we also have a node.js project that I work on so I was pleased to find that PyCharm supported the Node.js plugin.
After I installed it I was still having significant troubles getting a lot of the core node.js libraries and statements to be recognized by PyCharm. Most notably, PyCharm doesn't recognize the require or module statements.
Any ideas on what I could do to fix this?
Found the answer! In the Javascript tab of your project settings open the Library subtab. In there make sure you have the Node.js Core Modules and Node.js Globals checked as shown here.