node-casbin / express-authz

express-authz is an authorization middleware for Express.js based on Casbin
https://casbin.org
Apache License 2.0
62 stars 9 forks source link

unable to import using Typescript. Using node it is ok #11

Closed str3tch closed 4 years ago

str3tch commented 4 years ago

hi there,

I have installed the package and I can see it in my project's node_modules folder.

However, if I try to import the typescript way it cannot find the module:

import { authz } from 'casbin-express-authz';

If I use the old NodeJS way, using require, it can find the module:

var cas = require('casbin-express-authz');

See here, both methods are below. The TS version has an issue. image

And reports this error on building: image

From a little googling, perhaps express-authz is missing a types file?

nodece commented 4 years ago

Thanks @str3tch , v3.0.1 has been released.