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 in latest Chrome while accessing error.stack #167

Closed
uiteoi opened this issue Jan 16, 2017 · 6 comments
Closed

Uncaught TypeError in latest Chrome while accessing error.stack #167

uiteoi opened this issue Jan 16, 2017 · 6 comments

Comments

@uiteoi
Copy link
Contributor

uiteoi commented Jan 16, 2017

This was working very well until version 0.4.8.

After upgrading to version 0.4.9, I get in the console:

Uncaught TypeError
(anonymous)	@	browser-source-map-support.js.min:107
(anonymous)	@	browser-source-map-support.js.min:101
(anonymous)	@	browser-source-map-support.js.min:107
(anonymous)	@	browser-source-map-support.js.min:101
a	@	browser-source-map-support.js.min:101
b	@	browser-source-map-support.js.min:104
(anonymous)	@	browser-source-map-support.js.min:105
f	@	browser-source-map-support.js.min:105
i	@	pipelet.js:4203

The code in pipelet.js triggering this is:

      try {
        throw new Error( '' );
      } catch( e ) {
        var stack = e.stack // this is line 4203 in pipelet.js
        // use stack
      }
@LinusU
Copy link
Collaborator

LinusU commented Jan 16, 2017

Hmm, this was probably #159 then, @kpdecker any ideas? :)

@ardeois
Copy link
Contributor

ardeois commented Jan 16, 2017

I have the same issue. It looks like this is due to "fs".
The error for compiled version of 'browser-source-map-support' is "C.existsSync is not a function"

Looks like 'fs' is defined but not existsSync, I guess the bug is introduced by b19ff76#diff-f332e9a051ea7f7b602a3d633c506d30R77

If you run npm run serve-tests then go to http://127.0.0.1:1336/browser-test/ you'll reproduce the issue.

I'll try to see what I can do to fix it.

@ardeois
Copy link
Contributor

ardeois commented Jan 16, 2017

Found the issue, here is the fix: #168

@LinusU can you please check if that's ok publish a new version on npm?

Thanks !

@uiteoi
Copy link
Contributor Author

uiteoi commented Jan 17, 2017

Thanks for the quick fix and 0..4.10 release. The bug is gone for me.

@ardeois
Copy link
Contributor

ardeois commented Jan 17, 2017

Yes thanks! I confirm it's working for me as well.

@LinusU
Copy link
Collaborator

LinusU commented Jan 18, 2017

🎉 🎉

bestlucky0825 pushed a commit to bestlucky0825/node-source-map-support that referenced this issue May 30, 2022
Fixes evanw/node-source-map-support#167

Since version 0.4.9, we require `fs` but it should fail if we are in
a browser. However, `browser-source-map-support.js` is bundled with
browserify which converts unsupported builtins to empty object. See
https://github.com/substack/node-browserify/blob/8f5ebbf505/lib/builtins.js#L12
This PR checks if required `fs` contains `readFileSync` which is part
of `fs` API.
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

3 participants