scottdurow / dataverse-ify

Easily call the Dataverse WebApi from TypeScript using SDK style types, with a NodeJS implementation for integration testing.
MIT License
57 stars 14 forks source link

Cannot find module 'dataverse-ify/lib/xrm-webapi/TokenCache' #43

Open korakanchan opened 1 year ago

korakanchan commented 1 year ago

Token Aquisition Completed

C:\Projects\Typescript-Webresources\clientjs>npx dataverse-gen init Cannot find module 'dataverse-ify/lib/xrm-webapi/TokenCache' Require stack:

Getting above error

ckl-bso commented 1 year ago

@korakanchan this fixed it for me https://github.com/scottdurow/dataverse-gen/issues/28#issuecomment-1481205997

jcirujales commented 6 months ago

I still get this as well, and when I follow the "fix" then reference the Contact (IEntity) object from doing a .retrieve, I get the following error (see below):

const serviceClient = new XrmContextDataverseClient(Xrm.WebApi);
    try {
      const contact = await serviceClient.retrieve<Contact>("contact", contactId, true);

Metadata not found for contact. Please create the early bound types.

Update: Upgrading to version 2 did fix the issue, to fix the "Metadata not found" error, I added the following line: setMetadataCache(metadataCache) before declaring serviceClient,