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
Sorry, new to electron, so I'm probably doing something dumb... but I'm trying to spawn a child process from one of the redux actions just as a test. However, when I add the code:
import { actionCreatorVoid } from './helpers';
import * as process from 'child_process';
export const increment = actionCreatorVoid('INCREMENT_COUNTER');
export const decrement = actionCreatorVoid('DECREMENT_COUNTER');
export function incrementIfOdd() {
return (dispatch: Function, getState: Function) => {
const { counter } = getState();
if (counter % 2 === 0) {
return;
}
var ls = process.spawn('ls');
console.log(ls);
dispatch(increment());
};
}
export function incrementAsync(delay: number = 1000) {
return (dispatch: Function) => {
setTimeout(() => {
dispatch(increment());
}, delay);
};
}
i get the following error:
Uncaught TypeError: Cannot read property 'NODE_ENV' of undefined
I see that NODE_ENV is being set using the define plugin, so IDK if this is a bug or maybe what I'm trying to do isn't possible?
Any Insight would be appreciated! (EG if there is a better way/place to do this).
The text was updated successfully, but these errors were encountered:
ChuckJonas
changed the title
Calling child_process
Calling child_process Cannot read property 'NODE_ENV' of undefined
Jul 13, 2018
Sorry, new to electron, so I'm probably doing something dumb... but I'm trying to spawn a child process from one of the redux actions just as a test. However, when I add the code:
i get the following error:
I see that
NODE_ENV
is being set using the define plugin, so IDK if this is a bug or maybe what I'm trying to do isn't possible?Any Insight would be appreciated! (EG if there is a better way/place to do this).
The text was updated successfully, but these errors were encountered: