Closed lacuong2009 closed 1 year ago
I have tried to pass Moment to isolate but I got the error "could not be clone".
// import * as moment from 'moment';
const alias = 'moment'; const globalContextKey = 'globalMoment'; context.global.setSync( globalContextKey, new ivm.ExternalCopy({}).copyInto(), ); const gMoment = context.global.getSync(globalContextKey); gMoment.setSync( globalContextKey, new ivm.Reference(moment(), { unsafeInherit: true }).copySync(), );
Results:
Could you suggest the best way to resolve this?
https://github.com/laverdet/isolated-vm#frequently-asked-question
I have tried to pass Moment to isolate but I got the error "could not be clone".
// import * as moment from 'moment';
Results:
Could you suggest the best way to resolve this?