Liferay 7.1 + Angular 4 portlet

Ravi Shah, modified 7 Years ago. Junior Member Posts: 59 Join Date: 1/2/14 Recent Posts

Hi All, 

 

Have created an angular portlet in Liferay 7.1 CE with below command: 

blade create -t npm-angular-portlet -p com.liferay.npm.angular -c MyNpmAngularPortlet my-npm-angular-portlet

 

The angular version is 4.  Post deploying the portlet & adding it to the page gives following errors: 

1) Uncaught ReferenceError: process is not defined

It is showing error:

// patch process related methods
Zone.__load_patch('nextTick', function (global, Zone, api) {
    // patch nextTick as microTask
    patchMicroTask(process, 'nextTick', function (self, args) {
        return {
            name: 'process.nextTick',
            args: args,
            callbackIndex: (args.length > 0 && typeof args[0] === 'function') ? 0 : -1,
            target: process
        };
    });
});

 

2) Another error: 

test:773 Error: Load timeout for modules: metal-dom/src/all/dom,metal-uri/src/Uri,clay-tooltip/src/ClayTooltip,my-npm-angular-portlet@1.0.0

 

Any help or suggestion on this? 

 

Thanks in advance. 

thumbnail
Ivan Zaera, modified 7 Years ago. Regular Member Posts: 119 Join Date: 10/1/13 Recent Posts

Do you know which package is using process.nextTick()? Is it inside your code or in an npm package?

process is a Node.js global that is not available in the browser...

Fernando Rubí, modified 6 Years ago. New Member Post: 1 Join Date: 7/10/14 Recent Posts
Hello,

We are starting to trying the generator liferay bundle (https://github.com/liferay/liferay-npm-build-tools/wiki/How-to-use-generator-liferay-bundle) to create a portlet for an angular application. The portlet generated is deployed in liferay 7.1 without problems.
But, now we have a problem when we start to develop the application.The application includes a CRUD of different entities, it’s not about making a SPA.We get this error when try to show a simple component:
Unhandled Promise rejection: Failed to load home.component.html ; Zone: <root> ; Task: Promise.then ; Value: Failed to load home.component.html undefined

There are any sample of the bundle with a component included.

Thanks in advance.
Fernando
Michael El Khoury, modified 5 Years ago. New Member Posts: 9 Join Date: 9/18/19 Recent Posts
Hello,
I was facing the same problem.
What i did was stopping the server, cleaned its cache (temp and work folder), removed my portlet from the modules folder, restarted the server, it's working again!
I did this because In here (https://issues.liferay.com/browse/BLADE-248) they say i could be related to liferay cache...