Skip to content

Commit

Permalink
salesforce: fix any-ascii import
Browse files Browse the repository at this point in the history
  • Loading branch information
josephjclark committed Nov 30, 2023
1 parent f8406a3 commit 6b9202e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/salesforce/src/Adaptor.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,13 @@ import { expandReferences as newExpandReferences } from '@openfn/language-common
import jsforce from 'jsforce';
import flatten from 'lodash/flatten';

// use a dynamic import because any-ascii doesn't play well with the CLI
const anyAscii = import('any-ascii');
// use a dynamic import because any-ascii is pure ESM and doesn't play well with CJS
// Note that technically we should await this, but in practice the module will be loaded
// before execute is called
let anyAscii;
import('any-ascii').then(m => {
anyAscii = m.default;
});

/**
* Adds a lookup relation or 'dome insert' to a record.
Expand Down

0 comments on commit 6b9202e

Please sign in to comment.