Open ZhUyU1997 opened 2 years ago
I am using axios on node.js (4.x). It has the logic that checks if node env. It failed because of polyfill.
function getDefaultAdapter() { var adapter; if (typeof XMLHttpRequest !== 'undefined') { // For browsers use XHR adapter adapter = xhr; } else if (typeof browser$1 !== 'undefined' && Object.prototype.toString.call(browser$1) === '[object process]') { // For node use HTTP adapter adapter = http_1; } console.log("getDefaultAdapter", adapter,) return adapter; }
browser$1 is defined by polyfills/process-es6.js. But I think we should not inject it if using node.js.
polyfills/process-es6.js
var browser$1 = { nextTick: nextTick, title: title, browser: browser, env: env, argv: argv, version: version, versions: versions, on: on, addListener: addListener, once: once, off: off, removeListener: removeListener, removeAllListeners: removeAllListeners, emit: emit, binding: binding, cwd: cwd, chdir: chdir, umask: umask, hrtime: hrtime, platform: platform, release: release, config: config, uptime: uptime };
I am using axios on node.js (4.x). It has the logic that checks if node env. It failed because of polyfill.
browser$1 is defined by
polyfills/process-es6.js
. But I think we should not inject it if using node.js.