XRM-OSS / Xrm-WebApi-Client

A promise-based JavaScript library for the Microsoft Dynamics CRM WebApi - TypeScript type definitions available
https://xrm-oss.github.io/Xrm-WebApi-Client/
MIT License
100 stars 28 forks source link

WebApiClient.js is not loaded on Mobile version because of conflict with existing bluebird.js #19

Closed khorozhansky closed 7 years ago

khorozhansky commented 7 years ago

Hello, Looks like WebApiClient.js is not loaded on Mobile version (both phone and tablet) because of conflict with existing bluebird.js (which is loaded by default for mobile). Version: Dynamics 365 (Version 1612 (8.2.1.207) (DB 8.2.1.207) online) Do you have any workaround for making it working on Mobile? Thank you

khorozhansky commented 7 years ago

It seems the following workaround works. Add "noConfilct()" below: ... // Attach bluebird to WebApiClient WebApiClient.Promise = require("bluebird").noConflict(); ...

DigitalFlow commented 7 years ago

Hey @khorozhansky,

Thanks for creating this issue (and delivering the solution as well 😄 ).

I just published v3.4.2, which loads bluebird using the noConflict function. Can you check, whether this solves your problem?

Kind Regards, Florian

khorozhansky commented 7 years ago

Hi Florian, Sorry, only now continued with this, and it seems this workaround does not work always. It works on one environment and does not work on another. When it works it seems there is an issue inside anyway, just do not receive error message

DigitalFlow commented 7 years ago

Hi @khorozhansky,

Are you using the minified code? I experienced that the minified version was causing issues in the CRM app, while the normal one did work properly. I also wrote a section in the read me regarding this here. Can you test, whether the not minified version works?

Kind Regards, Florian

khorozhansky commented 7 years ago

Yes seems the issue in minified file. I've just tried not minified version and it works. Then I tried to use https://github.com/madskristensen/BundlerMinifier Visual Studio extention to make the minified version and it also looks working. Thanks

DigitalFlow commented 7 years ago

Hey @khorozhansky,

Great that it's working now. I'll close this issue but will have to check why uglifyjs and CRM don't like each other.

Kind Regards, Florian