Authorizer is not exported
See original GitHub issueSo, I just updated my Casbin.js version from 0.4.0
to 1.0.1
and I’ve run into the following error:
TS2305: Module '"/node_modules/casbin.js/lib"' has no exported member 'Authorizer'.
It seems that the Authorizer
class is not being exported anymore. I looked into the docs (here in Github and in the Casbin website), and both still cites the Authorizer
on how to use the lib.
Was the Authorizer
removal by design or is this a bug?
Steps to reproduce the error
- Simply install any version of Casbin after the version
0.4.0
; - Try to import Authorizer, as noted in the docs:
import { Authorizer } from 'casbin.js';
or
import * as casbinjs from 'casbin.js';
const authorizer = new casbinjs.Authorizer("manual")
Environment
I was able to reproduce this error in two different scenarios:
- Using React with CRA
- Using React with Vite
This error also persisted from the version 1.0.0-beta.1
, from what I tested.
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
API Gateway not importing exported definition - Stack Overflow
The error(s) that I get when importing a definition I had just exported are: Your API was not imported due to errors in...
Read more >Output from an Amazon API Gateway Lambda authorizer
A Lambda authorizer function's output is a dictionary-like object, which must include the principal identifier ( principalId ) and a policy document ...
Read more >Importing/Exporting Serverless Custom Authorizers Across ...
Now we have our BasicAuthorizer being exported, we can import it into our other stacks using the magic of the Intrinsic CloudFormation function ......
Read more >Question: Custom Authorizers · Issue #169 - GitHub
We are working on adding custom authorizer support for Swagger import and export, but this has not been released yet.
Read more >Import export doesn't work when authorization is activated
When you export, it exports fine. When you import, no such luck, because script upload is disabled. So, exception. My problem with this...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@armr-dev @GhostyJade Casbin.js v1.x has been deprecated, please use latest v0.4.1 instead: https://github.com/casbin/casbin.js/releases/tag/v0.4.1
This solved the issue. Thank you!