Comments (9)
I created kriszyp/cbor-x#100 over in the cbor-x project because I discovered that locally duplicating their index.d.ts as index-no-eval.d.ts in my example project here's node_modules/cbor-x/ folder allowed tsc
to understand types for cbor-x/index-no-eval
. However I couldn't think of anything clever to do on the SimpleWebAuthn side of the house to get TypeScript to "alias" the index.d.ts type declarations for cbor-x/index-no-eval
imports...
from simplewebauthn.
Okay, enough people are affected by this I think I'll have to revert #511 and figure something else out. The cbor-x project looks like it's being actively maintained, but there's evidence they may not have a lot of time to dedicate to addressing issues. I'll have to break Vercel's Edge runtime support for sake of restoring Node support, but my gut tells me there are more people in the latter group than the former.
from simplewebauthn.
Hello @mat813, thanks for the report. This is related to #511, weird that an issue like this wasn't caught locally or in CI. I'll dig into this and report back.
Can you share your project's tsconfig.json?
from simplewebauthn.
I have the same issue.
{
"ts-node": {
"files": true
},
"compilerOptions": {
"module": "commonjs",
"strict": true,
"strictPropertyInitialization": false,
"noImplicitOverride": true,
"declaration": true,
"removeComments": true,
"resolveJsonModule": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"target": "es6",
"lib": ["dom", "dom.iterable", "esnext"],
"sourceMap": true,
"outDir": "./dist",
"baseUrl": "./",
"incremental": true,
"paths": {
"@/*": ["./src/*"]
}
},
"exclude": ["node_modules", "dist", "tmp"],
"include": ["src", "test"]
}
Not sure if this is related, but for some reason the default export no longer works for me. Instead of
import SimpleWebAuthnServer from '@simplewebauthn/server';
I have to use
import * as SimpleWebAuthnServer from '@simplewebauthn/server';
We are running Typescript in version 5.3.3.
I removed the node_modules folder and installed all dependencies again, but the package doesn't seam to be installed.
$ npm why cbor-x/index-no-eval
npm ERR! No dependencies found matching cbor-x/index-no-eval
from simplewebauthn.
Here is my tsconfig.json :
{
"compilerOptions": {
"target": "es2021",
"module": "commonjs",
"esModuleInterop": true,
"noImplicitAny": true,
"outDir": "./built",
"sourceMap": true,
"inlineSources": true,
"sourceRoot": "/",
"noEmitHelpers": true,
"importHelpers": true,
"resolveJsonModule": true,
"strictBindCallApply": true,
"strictFunctionTypes": true,
"strictNullChecks": true
},
"types": ["jest", "jest-extended"],
"exclude": ["node_modules"],
"include": [
"apps/**/*.ts",
"graphql/**/*.ts",
"graphql/*.d.ts",
"mailers/**/*.ts",
"scripts/**/*.ts",
"ecosystem.json"
]
}
This still happens with @simplewebauthn/[email protected] and @simplewebauthn/[email protected].
from simplewebauthn.
Isn't @simplewebauthn/* installed in node_modules?
You may need to include "node_modules/@simplewebauthn/**/*.ts" since you excluded all of node_modules.
from simplewebauthn.
Good eye @spendres, I'll bet that's it. cbor-x/no-index-eval
is defined in the dependency's package.json here:
https://github.com/kriszyp/cbor-x/blob/0b5e8807622619c6a7a062f7e771478ecfd52f83/package.json#L59
If TypeScript can't see any types in node_modules/ (as evident in both tsconfig.json samples pasted above) I'm not surprised it's having issues transpiling.
My suggestion to fix that tsc
error is to move "node_modules"
from "exclude"
to "include"
instead and try again.
No, wait a minute, it's not that - exclude
is about what gets transpiled. I get this same issue with the example project once I install @simplewebauthn/types
(oops, gotta fix that) and then run npx tsc
in there.
Investigating...
from simplewebauthn.
I'm proposing fixing this issue by replacing use of cbor-x another library, tiny-cbor. @mat813 @sualko @mmv08 if you're feeling daring enough you can trying building and installing from the fix/513-cbor-x-type-issues branch to see if this fixes your issues. In my testing I think this is the solution, but extra confirmation couldn't hurt.
from simplewebauthn.
@mat813 @sualko @mmv08 This issue should be fixed in the newly published @simplewebauthn/[email protected]
from simplewebauthn.
Related Issues (20)
- VerifiedRegistrationResponse type missing transports attribute HOT 3
- failed test in packages/server HOT 4
- generateRegistrationOptions's `excludeCredentials` is returning empty string for each id HOT 1
- extractStrings is not a function HOT 3
- `pubKeyCredParams` field not properly functioning w/ non ES256 Algos on register HOT 2
- Unable to Register a Passkey Using a PIN Code HOT 2
- RFC: Rename @simplewebauthn/typescript-types to something shorter HOT 3
- Treat all custom string challenges as UTF-8 strings
- Uint8Array --> String --> Uint8Array Conversion from isoUint8Array helper doesn't work HOT 3
- ignore `node:crypto` import with webpack in `@simplewebauthn/server` HOT 8
- Update minimum Node support to v20+ HOT 3
- library reports lack of support to webauthn in mobile chrome but webauthn seems to work if using reference site HOT 8
- Using Android devices without non-Google Password managers fail to authenticate HOT 11
- Change signature of `decodeClientDataJSON` to accept `Base64URLString` as paramater HOT 2
- Improve ergonomics of `excludeCredentials` and `allowCredentials` HOT 3
- Remove footgun related to random user IDs HOT 16
- Update `getWebCrypto()` for Node 20 HOT 2
- cross-platform authenticator usage on android 14 HOT 1
- Default `userDisplayName` to empty string when not specified HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simplewebauthn.