dimanche 11 février 2018

How to properly destroy ember app and re-initialize a new one without re-defining methods that were previously defined

I am trying to load multiple ember apps in a spa using single-spa and single-spa-ember. However when I try to destroy an ember app and load another ember app I am getting following issue:

index.js:12 Uncaught TypeError: Cannot redefine property: Inflector at Function.defineProperty (<anonymous>) at Module.callback (index.js:12) at Module.exports (loader.js:106) at Module._reify (loader.js:143) at Module.reify (loader.js:130) at Module.exports (loader.js:104) at Module._reify (loader.js:143) at Module.reify (loader.js:130) at Module.exports (loader.js:104) at Module._reify (loader.js:143)

It definitely seems like when loading a new ember app, the Ember.Inflector is trying to be re-defined it again even when "EXTEND_PROTOTYPES" has been disabled. I have an example demonstrating the issue here : https://github.com/dshrestha/ember-spa

single-spa provides hooks to handle loading/unloading the app, while sigle-spa-ember already provides the default implementation of the hook for ember app. I have tried deleting Inflector method before the ember app gets unmount(https://github.com/dshrestha/ember-spa/blob/master/src/ember-4/app/app.js#L30) but that didn't work for me.




Aucun commentaire:

Enregistrer un commentaire