Continuing the discussion with #3, I am able to somewhat bypass that with this hacky solution. But needed a better approach or refined one with the official library itself:
function mount(opts) {
return Promise
.resolve()
.then(() => {
window.dcx.desk = window.dcx.desk || {};
if(window.dcx.desk.Ember) {
const {Ember, entries} = window.dcx.desk;
window.Ember = Ember;
window.require.entries = entries;
}
opts.applicationInstance = opts.App.create(opts.createOpts);
})
}
function unmount(opts) {
return Promise
.resolve()
.then(() => {
opts.applicationInstance.destroy();
opts.applicationInstance = null;
window.dcx.desk = window.dcx.desk || {};
window.dcx.desk = {
Ember: window.Ember,
entries: window.require.entries
}
delete window.Ember;
});
}
Still I am getting error when switching back to different Ember apps something like:
Uncaught Error: Could not find module `desk/router` imported from `(require)`
at vendor.js:12
at l (vendor.js:12)
at requireModule (vendor.js:6)
at r._extractDefaultExport (vendor.js:4410)
at resolveOther (vendor.js:4378)
at resolve (vendor.js:4388)
at vendor.js:1673
at e.resolve (vendor.js:1676)
at e.resolve (vendor.js:1677)
at p (vendor.js:1652)
@joeldenning Please let me know your thoughts on this.
Continuing the discussion with #3, I am able to somewhat bypass that with this hacky solution. But needed a better approach or refined one with the official library itself:
Still I am getting error when switching back to different Ember apps something like:
@joeldenning Please let me know your thoughts on this.