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

Cannot use in non-browserified client environment #47

Closed
rahatarmanahmed opened this issue Dec 23, 2015 · 0 comments
Closed

Cannot use in non-browserified client environment #47

rahatarmanahmed opened this issue Dec 23, 2015 · 0 comments

Comments

@rahatarmanahmed
Copy link
Contributor

The following statement on the README is not accurate:

Environment doesn't support requiring fetch-mock?

If your client-side code or tests do not use a loader that respects the browser field of package.json use require('fetch-mock/es5/client'). This can also be loaded directly in a script tag as ./node_modules/fetch-mock/es5/client.js (Disclaimer: I haven't actually tried this, but it should work)

es5/client.js is just a babel compiled version of src/client.js, which still attempts to use require. We need another folder (perhaps browser/) that contains a browserify-compiled version of src/client.js.

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