Comments (4)
I'm not very familiar with nextjs and your project. I can just say that isAvailable()
is meant to be called at runtimevin the browser (to discover the browser/platform capabilities). It is not something to be called server-side and pre-rendered. So of course the window
object is necessary at that point. The issue as far as I understand is unrelated to this library but because you use isAvailable()
to pre-render server side. Feel free to reopen the issue if I missed something.
from webauthn.
...that goes for all the webauthn.client.*
stuff of course. It's for the browser at runtime, not for server side rendering.
from webauthn.
vercel/next.js#47028 (comment)
Searching for similar discussions, I've found this sentence: "Client components are rendered on the server too.". Therefore, window
is undefined in first render.
To solve it on Next project, there's need for a useState and a useEffect, adding complexity to codebase to every component where this lib is called.
Can't this lib check for typeof window !== undefined
before to do what's necessary? Obviously, if complexity don't increase as much as I mentioned.
from webauthn.
Without window, the lib obviously cannot check if WebAuthn is available for that browser. It doesn't even make sense.
from webauthn.
Related Issues (20)
- Using 1Password does not work on demo HOT 1
- Update authenticator names list HOT 1
- Display QR code immediatly HOT 7
- Allow passing `authenticatorSelection.residentKey` option in `client.register` HOT 9
- Import issue in Nestjs HOT 9
- Compatibility with 1Password and Bitwarden HOT 4
- Counters don't work on macbook HOT 5
- Server should not log to console.debug HOT 5
- Issue with ES Modules in firebase functions HOT 4
- ReferenceError: crypto is not defined HOT 1
- verifyAuthentication ERR_OSSL_EVP_DECODE_ERROR HOT 6
- Unexpected RpIdHash HOT 15
- Does it has commonjs version? HOT 3
- Upcoming changes for version "2"? HOT 12
- Error registering key using 1Password HOT 3
- Error: DOMException: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission HOT 2
- ReferenceError: crypto is not defined HOT 7
- Passwordless login with passkeys HOT 4
- Missing crypto import? HOT 3
- Error: ReferenceError: module is not defined in ES module scope in SvelteKit/Vite 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 webauthn.