Comments (6)
The problem is the assumption that the current console object is the NodeJS object. For example if you use a log framework as electron-log the Console costructor don't exists.
A simple patch ( work in my case ) is:
@@ -435,7 +437,12 @@ export class PluginVm {
sandbox.process = Object.create(srcGlobal.process || null);
}
if (!sandbox.console) {
- sandbox.console = new console.Console({ stdout: process.stdout, stderr: process.stderr });
+ if(console.Console){
+ sandbox.console = new console.Console({ stdout: process.stdout, stderr: process.stderr });
+ } else {
+ const { Console } = require('console');
+ sandbox.console = new Console({ stdout: process.stdout, stderr: process.stderr });
+ }
}
// override the global obj to "unlink" it from the original global obj
from live-plugin-manager.
Can you try to execute that on your environment?
console.Console({ stdout: process.stdout, stderr: process.stderr });
As described here: https://nodejs.org/docs/latest-v12.x/api/console.html#console_new_console_stdout_stderr_ignoreerrors
I suspect that console
is not available in Electron or something similar. I'm not expert about Electron. Which node version are you using? Electron uses a built-in version?
thanks
from live-plugin-manager.
I believe latest Electron bundles Node 12.16.3. Thanks, I’ll look into it
from live-plugin-manager.
Thanks @dianlight ! Do you want to create a PR?
from live-plugin-manager.
It would be great to have some sort of unit test or example to reproduce this problem...
from live-plugin-manager.
@davideicardi now I don’t have much time. I will see what I can do.
from live-plugin-manager.
Related Issues (20)
- 'window.webkitStorageInfo' is deprecated. Please use 'navigator.webkitTemporaryStorage' or 'navigator.webkitPersistentStorage' instead. HOT 3
- 0.14.1 -> 0.15.1 issue on 0.15.1 HOT 2
- no such file or directory, mkdir '/plugin_packages' HOT 4
- getInfo should load the package from disk HOT 2
- Proxy settings for NPM registry HOT 1
- Support loading plugins without FS access HOT 1
- fix: circular dependencies result in endless loop + out of memory crash HOT 3
- Plugin manager require gives module not found but passing the path directly works HOT 4
- Plugin manager gives an error requiring aws-sdk HOT 3
- sharp lib install failed HOT 2
- Error when using require to load an ES6 module HOT 7
- PluginManager.install is not compatible with NodeJS workers HOT 1
- Literal Object prototype is not working properly inside the plugin's context HOT 9
- Module not found: Can't resolve 'console' in React HOT 2
- Error: Invalid plugin github repository HOT 2
- Improper Error handling HOT 1
- PluginVm.getScopedInfo could not get the correct scope if it contains a dot HOT 1
- Handling modules with index.json entrypoints HOT 2
- FR: Support for `"exports"` in `package.json` HOT 1
- Error: Code generation from strings disallowed for this context HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from live-plugin-manager.