Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
Portlets created with yo liferay-js fail to render
			Hi,
Liferay 7.2, Chrome 78.0.3904.70
Have been following the "Developing Web Front Ends" Vue application subsection to create a "Hello World" type portlet to add to Liferay. I'm new to Liferay.https://portal.liferay.dev/docs/7-2/appdev/-/knowledge_base/a/developing-a-vue-application
I have created two portlets, one based on "Vue" and the other "Pure JavaScript", letting the tool add the default content to the portlets.Without changing anything I have successfully deployed both to a local version on liferay (a clean version using the default test database).
Neither Portlet will render once added to a content page. I get the following error, for both tested independently, which is traced back to an invalid JSON string.
Extract from error origin (http://localhost:8080/web/guest/pure-javascript-portlet-content-page-):
		Liferay 7.2, Chrome 78.0.3904.70
Have been following the "Developing Web Front Ends" Vue application subsection to create a "Hello World" type portlet to add to Liferay. I'm new to Liferay.https://portal.liferay.dev/docs/7-2/appdev/-/knowledge_base/a/developing-a-vue-application
I have created two portlets, one based on "Vue" and the other "Pure JavaScript", letting the tool add the default content to the portlets.Without changing anything I have successfully deployed both to a local version on liferay (a clean version using the default test database).
Neither Portlet will render once added to a content page. I get the following error, for both tested independently, which is traced back to an invalid JSON string.
loader.js:381 SyntaxError: Unexpected token p in JSON at position 22
    at JSON.parse (<anonymous>)
    at pure-javascript-portlet-content-page-:2614
    at loader.js:379
    at loader.js:343
</anonymous>Extract from error origin (http://localhost:8080/web/guest/pure-javascript-portlet-content-page-):
if (initializer) {
     initializer(
       {
           configuration: {
                portletInstance: JSON.parse('{"portletSetupCss":"{\"portletData\":{\"useCustomTitle\":false,\"titles\":{},\"portletDecoratorId\":\"\"},\"advancedData\":{\"customCSSClassName\":\" portlet-barebone\"}}"}'),
                            system: JSON.parse('{}')
           },
           contextPath: '/o/pm-pure-js-portlet',
           portletElementId: 'js-portlet-_pmpurejsportlet_INSTANCE_KSG7kFL4NZ9f_',
           portletNamespace: '_pmpurejsportlet_INSTANCE_KSG7kFL4NZ9f_'
     );
}
			Yes that's definitely it.
Thanks for the quick reply!
Fraser
		Thanks for the quick reply!
Fraser