driverdan / node-XMLHttpRequest

XMLHttpRequest for node.js
http://thedanexperiment.com/2009/10/04/emulating-xmlhttprequest-in-node-js/
MIT License
416 stars 299 forks source link

Usage with TypeScript and Webpack. Can't resolve 'child_process' error #165

Closed vyushin closed 6 years ago

vyushin commented 6 years ago

Hi! Can I use XMLHttpRequest with TypeScript?

I tried this code in index.ts file

import {XMLHttpRequest} from 'xmlhttprequest';
const request = new XMLHttpRequest();

Got error:

image

yankouskia commented 6 years ago

@vyushin if you use webpack, just add

node: {
  child_process: 'empty',
},

to your configuration

vyushin commented 6 years ago

@yankouskia, thanks for answer. I removed this package from my project. But I remember your solution. :)