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

Feature-Request: browser compatibility #60

Open
mattmeye opened this issue Jul 17, 2018 · 10 comments
Open

Feature-Request: browser compatibility #60

mattmeye opened this issue Jul 17, 2018 · 10 comments

Comments

@mattmeye
Copy link

If i use angular with verror, i get

ERROR in ./node_modules/assert-plus/assert.js
Module not found: Error: Can't resolve 'stream' in '..\myapp\node_modules\assert-plus'

in the compiler

@TheDocTrier
Copy link

TheDocTrier commented Sep 10, 2018

I'm not an expert in the project by any means, but I'm pretty sure that it only supports a NodeJS environment. When you use Angular, you're trying to use verror in a browser environment (which doesn't have modules such as "stream" available). This doesn't look like it's an issue with verror, unless this is meant to be a feature request for implementing a browser version of verror. If that was done, it would probably have to be in a limited form.

It appears actually that the error you're getting isn't even from verror directly but from one of its dependencies. Unless verror switches dependencies or re-implements their own version which doesn't require any node modules, they can't fix this "issue."

@mattmeye mattmeye changed the title Angular with Verror Feature-Request: browser compatibility Sep 10, 2018
@mattmeye
Copy link
Author

yes you are right, i changed the title to a feature request.

@benwinding
Copy link

Is there any progress on this, would love to use this in an Angular app too!

@davepacheco
Copy link
Contributor

I don't know of anybody working on it. Sorry.

@bertho-zero
Copy link

I opened a PR exactly for that: #59

@bertho-zero
Copy link

bertho-zero commented May 6, 2020

I just published @openagenda/verror, it's a complete rewrite with some changes:

  • Rewritten with ES classes
  • Is now browser compatible, no more dependencies linking it to Node
  • findCauseByType and hasCauseWithType methods have been added
  • SError class has been removed

https://www.npmjs.com/package/@openagenda/verror

BREAKING CHANGE: The VError creation without new keyword is no longer available.

And I fixed this issue: #78

@jfmmm
Copy link

jfmmm commented Sep 25, 2020

@bertho-zero Your fork on bitbucket seem to be private, unless it was deleted. Can you make that public.

@bertho-zero
Copy link

bertho-zero commented Sep 25, 2020

I extracted the repo: https://github.com/Oagenda/verror

I reverted to using prototypes rather than classes so I could create errors without new, like Error.

@fabis94
Copy link

fabis94 commented Nov 6, 2020

@bertho-zero any chance you can also add TypeScript types? would be much appreciated

@bertho-zero
Copy link

I've never used TypeScript, but someone familiar with it can open a PR.

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

7 participants