Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught TypeError: Cannot read property 'from' of undefined #92

Open
jpke opened this issue Jul 3, 2018 · 0 comments
Open

Uncaught TypeError: Cannot read property 'from' of undefined #92

jpke opened this issue Jul 3, 2018 · 0 comments

Comments

@jpke
Copy link

jpke commented Jul 3, 2018

Getting this error when attempting to use this library wrapped by http or https:

Uncaught TypeError: Cannot read property 'from' of undefined
  | (anonymous) | @ | index.js:11
-- | -- | -- | --
  | ./node_modules/safe-buffer/index.js | @ | vendor.2.55.0.js:6783
  | __webpack_require__ | @ | manifest.2.55.0.js:55
  | (anonymous) | @ | _stream_readable.js:55
  | (anonymous) | @ | _stream_readable.js:1020
  | ./node_modules/readable-stream/lib/_stream_readable.js | @ | vendor.2.55.0.js:6709
  | __webpack_require__ | @ | manifest.2.55.0.js:55
  | (anonymous) | @ | readable-browser.js:1
  | ./node_modules/readable-stream/readable-browser.js | @ | vendor.2.55.0.js:6755
  | __webpack_require__ | @ | manifest.2.55.0.js:55
  | (anonymous) | @ | response.js:3
  | (anonymous) | @ | response.js:226
  | ./node_modules/stream-http/lib/response.js | @ | vendor.2.55.0.js:6825
  | __webpack_require__ | @ | manifest.2.55.0.js:55
  | (anonymous) | @ | request.js:3
  | (anonymous) | @ | request.js:329
  | ./node_modules/stream-http/lib/request.js | @ | vendor.2.55.0.js:6818
  | __webpack_require__ | @ | manifest.2.55.0.js:55
  | (anonymous) | @ | index.js:1
  | (anonymous) | @ | index.js:86
  | ./node_modules/stream-http/index.js | @ | vendor.2.55.0.js:6804

Looks like its related to:

var buffer = __webpack_require__("./node_modules/webpack/node_modules/node-libs-browser/mock/empty.js")
var Buffer = buffer.Buffer

// alternative to using Object.keys for old browsers
function copyProps (src, dst) {
  for (var key in src) {
    dst[key] = src[key]
  }
}
if (**Buffer.from** && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
  module.exports = buffer
} else {
  // Copy properties from require('buffer')
  copyProps(buffer, exports)
  exports.Buffer = SafeBuffer
}```

Occurs on both Chrome 67.0.3396.99  and Firefox 61.0 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant