Skip to content
This repository has been archived by the owner on Feb 5, 2024. It is now read-only.

Browserify example returns "Uncaught TypeError: undefined is not a function :5811" #76

Closed
digihaven opened this issue Feb 22, 2015 · 3 comments

Comments

@digihaven
Copy link

The line that chrome complains about:

content = fs.readFileSync(file, 'ascii'),

In this function:

/**
 * Load an Apache2-style ".types" file
 *
 * This may be called multiple times (it's expected).  Where files declare
 * overlapping types/extensions, the last file wins.
 *
 * @param file (String) path of file to load.
 */
Mime.prototype.load = function(file) {

  this._loading = file;
  // Read file and split into lines
  var map = {},
      content = fs.readFileSync(file, 'ascii'),
      lines = content.split(/[\r\n]+/);
@jondashkyle
Copy link

Getting this too

@timwis
Copy link

timwis commented Apr 11, 2015

Any work-arounds for this?

@WyohKnott
Copy link

You need to update your Request dependency, c.f. this bug request/request#455
Request was using the mime package which was incompatible with Browserify, and switched over mime-types instead.
You should be bumping it to "request": "~2.51.0" at least.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants