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
RE: Why Liferay don't recognize jspdf
I'm trying to deploy my aplication React in Liferay, but when is added like widget nothing happens.
Neither happens errors, but if I run the aplication with npm start, it works correctly

Is the javascript with the react app even loaded? Did you check in the browser developer tools? Do you see any errors in the browser console?
What is your project setup? How did you create it? Did you use the generator?
https://github.com/liferay/liferay-js-toolkit/wiki/How-to-use-generator-liferay-js
Or did you use liferay-js:adapt to package your widget?
https://help.liferay.com/hc/en-us/articles/360035467712-Adapting-Existing-Apps-to-Run-on-Liferay-DXP
Hi Christoph Rabel for you answer.
I used liferay-js:adapt for my project
I don't see any error in the browser console
Is the javascript with the react app even loaded? -> How can I verify that?
Hi Christoph Rabel for you answer.
I used liferay-js:adapt for my project
I don't see any error in the browser console
Is the javascript with the react app even loaded? -> How can I verify that?
You could try to check in the network tab. Search for "my-app" (or whatever your module is called). You should see some requests like these:
http://localhost:8080/o/js_resolve_modules?modules=my-app@0.1.0
http://localhost:8080/combo/?.../o/js/resolved-module/my-app@0.1.0/static/js/runtime-main.js&/o/js/resolved-module/my-app@0.1.0/static/js/2.chunk.js&/o/js/resolved-module/my-app@0.1.0/static/js/main.chunk.js&/o/js/resolved-module/my-app@0.1.0/adapt-rt.js&/o/js/resolved-module/my-app@0.1.0/index.js
In general, it is really hard to tell why it does not work for you. It works for me.
Did you change anything on the page or try start from scratch? Create react app, adapt, deploy? Which Liferay version do you use?
Yes, I see this:

But if I created the app ("my-app3) whit the liferay generator, the error is the next:

Ok, replying to myself since I can't reply to Andres Toros post.
I tried it now myself with jsPDF and adapt. I see the problem. The js-adapt code assumes that there will be only two chunks. It loads main.chunk and 2.chunk.
BUT when you add jsPDF, you get six chunks and the chunk files 3-6 are not requested in the combo call. -> Can't work.
I actually have no idea how to fix this. You could try to ask on github, maybe they can tell you what you could do:
https://github.com/liferay/liferay-js-toolkit