Skip to content

Commit

Permalink
(api) fixed issue on module imports
Browse files Browse the repository at this point in the history
  • Loading branch information
inlife committed Mar 14, 2024
1 parent 92724ff commit 9b7fe53
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/nexrender-api/src/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
// require node fetch if we are in nodejs environment (not browser)
const localFetch = typeof process == 'undefined' ? fetch : require('node-fetch')
const fetchAgent = typeof process == 'undefined' ? null : { // eslint-disable-line multiline-ternary
let localFetch = typeof process == 'undefined' ? fetch : require('node-fetch')
let fetchAgent = typeof process == 'undefined' ? null : { // eslint-disable-line multiline-ternary
http: require('http').Agent,
https: require('https').Agent,
}

const pkg = require('../package.json')

const createClient = ({ host, secret, polling, headers, name }) => {
if (localFetch.default) {
localFetch = localFetch.default
}

const wrappedFetch = async (path, options) => {
options = options || {}
const defaultHeaders = {};
Expand Down

0 comments on commit 9b7fe53

Please sign in to comment.