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

Incompatible with webpack #13

Closed
morgante opened this issue Nov 20, 2015 · 7 comments
Closed

Incompatible with webpack #13

morgante opened this issue Nov 20, 2015 · 7 comments

Comments

@morgante
Copy link

This module is unfortunately currently incompatible with webpack. It produces the following error when built in a webpack environment:

define cannot be used indirect

The underlying issue is actually with json-schema, but because that module hasn't been updated since 2012 I might suggest choosing a different tool.

@jclulow
Copy link
Contributor

jclulow commented Nov 20, 2015

@morgante And what tool might you suggest? As far as I can tell, json-schema still works just fine, even though nobody has changed it in three years.

@morgante
Copy link
Author

is-my-json-valid seems to be updated quite regularly, so it might be worth trying.

You're right that it does seem json-schema is still mostly working, so it might be worth considering a fork if the issue isn't addressed soon.

@Verikon
Copy link

Verikon commented Nov 30, 2015

Plus 1. Webpack is complaining about json-schema/lib/validate.js, line 16 - specifically how it redeclares define to a new function ; comment that line out and jsprim works fine under webpack.

@bingomanatee
Copy link

  • getting this issue as well.

@davepacheco
Copy link
Contributor

Because we use this validator in several latency-sensitive, internet-facing services, in order to switch implementations, we'd need to verify that there are no semantic changes (i.e., the new implementation rejects any invalid inputs rejected by the old implementation, and accepts valid inputs accepted by the old implementation) and no significant performance regressions (since existing implementations vary in latency by orders of magnitude). At the very least, any semantic differences would need to be well-understood and documented for a major bump of this module. We'd also need to normalize the reported errors to match the existing ones that this library emits.

It's a fair bit of work for someone to find a new implementation, integrate it into this module (translating errors), do the semantic testing, and do the performance testing. If someone steps up to do that, we'd be happy to review the test results and take that PR, as long as it meets the above requirements.

I'm sorry that the json-schema dependency is affecting people's ability to use this module with webpack, but I don't believe any of the current maintainers has the interest or time to do that work ourselves, especially to work around what sounds like a deficiency in webpack.

@ForsakenHarmony
Copy link
Contributor

you just have to bump the json-schema version

@davepacheco
Copy link
Contributor

Fixed in version 1.3.1.

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

6 participants