Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught DOMException: Failed to execute 'define' encountered when oj libraries are overlapped #43

Open
vinyass opened this issue Jun 13, 2018 · 1 comment

Comments

@vinyass
Copy link

vinyass commented Jun 13, 2018

I had built a custom module based on oj3 which now I have migrated to oj5 and I am trying to consume this in another module (also using oj5). However, when I try to load the page, it gives below error:-
Uncaught DOMException: Failed to execute 'define' on 'CustomElementRegistry': this name has already been used with this registry at Object../node_modules/@oracle/oraclejet/dist/js/libs/oj/debug/ojcomponentcore.js.oj.CustomElementBridge.register

On looking further, I found that a certain 'oj-surrogate' is being registered in ojpopupcore.js (line: 1988) like this:-
oj.CustomElementBridge.register('oj-surrogate', {'metadata' : oj.CustomElementBridge.getMetadata('oj-surrogate')});
which is throwing this exception.

I am not sure if it is because of overlapping libraries between the built bundles of the component and the consumer.
Note:- This issue did not occur in previous version of OJ. It only came up after upgrading to OJ5.

@gvanmat
Copy link
Member

gvanmat commented Jun 14, 2018

@vinyass The "oj-surrogate" component is located in the "ojpopupcore" jet module. Sounds like this module is getting loaded a second time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants