question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unusable on Node < 6 due to source-map@0.7.0

See original GitHub issue

Version 0.7.0 of source-map fails to load on Node < 6 due to let without 'use strict'. This causes the following error:

> require('gulp-sourcemaps');
/path/to/node_modules/source-map/lib/source-map-consumer.js:72
  let consumer = null;
  ^^^

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:387:25)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Object.<anonymous> (/tmp/node_modules/source-map/source-map.js:7:29)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)

mozilla/source-map#311 has been opened, but since source-map declares "node": ">= 8" I suspect the bug is with gulp-sourcemaps. I would argue that this package should depend on "source-map": "^0.6.0". If support for Node < 6 is not required, the dependency could be changed to "source-map": "^0.7.0" along with "node": ">= 8" as part of a major release of this package.

Thanks for considering, Kevin

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:5
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
gormaccommented, Jan 22, 2018

I think we might need "source-map": "~0.6.0" for this (tilde in stead of caret). Fixes my build. See PR #344.

2reactions
nmccreadycommented, Jan 22, 2018

Please make sure this fix is also propagated to versions 1.X since it’s currently breaking production projects. Thanks!

https://github.com/gulp-sourcemaps/gulp-sourcemaps/commit/3ce7c6662de0bb7c5427a01872d9902929bae580#diff-b9cfc7f2cdf78a7f4b91a753d10865a2

@gormac 's PR is merged. TY

Read more comments on GitHub >

github_iconTop Results From Across the Web

SyntaxError: Block-scoped declarations (let, const, function, class ...
hello, I'm using gulp-sourcemaps v1.12.0, and now has an error in your ... Unusable on Node < 6 due to source-map@0.7.0 gulp-sourcemaps/gulp-sourcemaps#343.
Read more >
#1012130 - node-source-map: Browser bundle unusable - Debian ...
Found in version node-source-map/0.7.0++dfsg2+really.0.6.1-10 ... src:ruby-terser src:ruby-uglifier Build with webpack 5 produces an unusable bundle.
Read more >
code is not running after re-downloading code from github
So i made a mistake on my code. then I downloaded my code from stable version I had on git. now I cant...
Read more >
Firebase JavaScript SDK Release Notes - Google
Fixed issue where clients using Node.js v18 would use the native Blob object, which is incompatible with node-fetch . See Github PR #6705....
Read more >
gulp-header-comment | Yarn - Package Manager
release : prepare next release (e38fa5c); release: release version (b15d7df) ... handle gulp-sourcemaps (82b7342), closes #225; chore: support only node >= 6 ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found