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

Client is not working in browser. #294

Closed
Invader444 opened this issue Oct 5, 2019 · 5 comments
Closed

Client is not working in browser. #294

Invader444 opened this issue Oct 5, 2019 · 5 comments
Labels
support Questions, discussions, and general support

Comments

@Invader444
Copy link

Support plan

  • which support plan is this issue covered by? : Community
  • is this issue currently blocking your project? : yes
  • is this issue affecting a production system? : no

Context

  • node version: n/a
  • module version: 11.2.2
  • environment (e.g. node, browser, native): browser
  • used with (e.g. hapi application, another framework, standalone, ...): electron
  • any other relevant information: This commit in Joi is suspect

What are you trying to achieve or the steps to reproduce?

`import { Client } from '@hapi/nes'`

What was the result you got?

index.js?cf2e:63 Uncaught TypeError: Joi.binary is not a function
    at eval (index.js?cf2e:63)
    at Object../app/node_modules/@hapi/nes/lib/index.js (bundle.js:3746)
    at __webpack_require__ (bundle.js:727)
    at fn (bundle.js:101)
    at Module.eval (networking.js:2)
    at eval (networking.js:354)
    at Module../app/js/sagas/networking.js (bundle.js:2907)
    at __webpack_require__ (bundle.js:727)
    at fn (bundle.js:101)
    at Module.eval (index.js:19)

What result did you expect?

No error should be thrown.

@Invader444 Invader444 added the support Questions, discussions, and general support label Oct 5, 2019
@hueniverse
Copy link
Contributor

Can you try import Client from '@hapi/nes/lib/client' instead?

@hueniverse hueniverse self-assigned this Oct 6, 2019
@Invader444
Copy link
Author

import { Client } from '@hapi/nes/lib/client'

or

const Client = require('@hapi/nes/lib/client').Client

Works as a workaround for now. Thank you!

@hueniverse
Copy link
Contributor

Can you try one more thing for me? Can you add "browser": "lib/client.js" to package.json locally and see if that also works?

@hueniverse
Copy link
Contributor

If someone can try the proposed change above to package.json we might be able to just fix it.

@hueniverse hueniverse removed their assignment Jul 5, 2020
@julianYaman
Copy link

Got problems with it in Next.js. Did anyone else experienced something like that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support Questions, discussions, and general support
Projects
None yet
Development

No branches or pull requests

3 participants