Node-jsonwebtoken: Broken Joi dependency

Created on 3 May 2016  路  5Comments  路  Source: auth0/node-jsonwebtoken

Upgraded dependencies of a project, now getting errors with the version of joi included in the project:

ERROR in ./~/joi/lib/string.js
Module not found: Error: Cannot resolve module 'net' in D:\Documents\GitHub\project-admin\node_modules\joi\lib
 @ ./~/joi/lib/string.js 3:10-24

ERROR in ./~/isemail/lib/isemail.js
Module not found: Error: Cannot resolve module 'dns' in D:\Documents\GitHub\project-admin\node_modules\isemail\lib
 @ ./~/isemail/lib/isemail.js 45:10-24

Joi isn't a dependency in this project, this is the only module that has this dependency.

Have run npm cache clean and done a fresh install, still having this issue. Dropped back to 5.7.0 and it works fine.

Most helpful comment

On the browser use jwt-decode. https://github.com/auth0/jwt-decode

All 5 comments

net and dns are node.js native modules almost since its conception.

This module is supposed to be used only in node.js, not in the browser or any other javascript environment.

can you give me more details of where are you trying to use it?

@jfromaniello Ahh ok, might explain it.

It's being used in the browser as part of an ES6 React/Redux app being built with webpack. Environment is node v4.4.1 when building.

So this module is node only (now)? Up to 5.7.0 it was working fine in the browser - so I assume I'll have to switch to jwt-decode then?

On the browser use jwt-decode. https://github.com/auth0/jwt-decode

same issue..

It has been always a node.js module only.

If you need to decode in the browser please use jwt-decode.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

itamarwe picture itamarwe  路  3Comments

AndreOneti picture AndreOneti  路  3Comments

BarukhOr picture BarukhOr  路  4Comments

rockchalkwushock picture rockchalkwushock  路  4Comments

shea256 picture shea256  路  3Comments