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

Primeui not working in modular environment #287

Open
Mobe91 opened this issue Mar 19, 2018 · 0 comments
Open

Primeui not working in modular environment #287

Mobe91 opened this issue Mar 19, 2018 · 0 comments

Comments

@Mobe91
Copy link

Mobe91 commented Mar 19, 2018

I have been trying hard to get primeui working using the SystemJS module loader. I have documented my efforts in this thread.
I tried using AMD and CJS module formats.

Importing primeui in AMD format results in the following error:

Unhandled rejection (SystemJS) Multiple anonymous defines in module http://localhost:9000/jspm_packages/npm/primeui@4.1.15/primeui.js
	Error: Multiple anonymous defines in module http://localhost:9000/jspm_packages/npm/primeui@4.1.15/primeui.js
	    at eval (http://localhost:9000/jspm_packages/npm/primeui@4.1.15/primeui.js:274:9)
	    at eval (http://localhost:9000/jspm_packages/npm/primeui@4.1.15/primeui.js:285:2)
	    at eval (http://localhost:9000/jspm_packages/npm/primeui@4.1.15/primeui.js:14801:3)
	    at eval (<anonymous>)
	    at r (http://localhost:9000/jspm_packages/npm/bluebird@3.4.1/js/browser/bluebird.min.js:33:7722)
	    at i._settlePromiseFromHandler (http://localhost:9000/jspm_packages/npm/bluebird@3.4.1/js/browser/bluebird.min.js:32:13044)
	    at i._settlePromise (http://localhost:9000/jspm_packages/npm/bluebird@3.4.1/js/browser/bluebird.min.js:32:13847)
	    at i._settlePromise0 (http://localhost:9000/jspm_packages/npm/bluebird@3.4.1/js/browser/bluebird.min.js:32:14548)
	Evaluating http://localhost:9000/jspm_packages/npm/primeui@4.1.15/primeui.js
	Error loading http://localhost:9000/jspm_packages/npm/primeui@4.1.15/primeui.js as "npm:primeui@4.1.15/primeui.js" from http://localhost:9000/jspm_packages/npm/primeui@4.1.15.js

Importing primeui in CJS format works fine but no widget factories are invoked. When I invoke the imported module manually, only the last factory is invoked of the list of widget factories listed in sequence in primeui.js. This is because the module.exports is overwritten each time.

I got primeui working in a non-modular environment using browser globals. So maybe I am overlooking something but I have no idea how this is supposed to work in a modular setup.

Thanks for any pointers.

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

1 participant