atinux / nuxt-auth-utils

Add Authentication to Nuxt applications with secured & sealed cookies sessions.
MIT License
973 stars 91 forks source link

Nuxt Build Error: "startRegistration" is not exported by "@simplewebauthn/browser" #252

Closed PGLongo closed 1 month ago

PGLongo commented 1 month ago

Description:
I encountered an error while running nuxt build in the project. The error appears to be caused by the missing export of the startRegistration function from the @simplewebauthn/browser dependency within nuxt-auth-utils.

Steps to reproduce:

  1. Add nuxt-auth-utils to the project.
  2. Run the nuxt build command.

Expected behavior:
The build should complete without errors.

Actual behavior:
The following error is displayed during the build:

[error] Nuxt Build Error: node_modules/nuxt-auth-utils/dist/runtime/app/composables/webauthn.js (6:2): "startRegistration" is not exported by "__vite-optional-peer-dep:@simplewebauthn/browser:nuxt-auth-utils", imported by "node_modules/nuxt-auth-utils/dist/runtime/app/composables/webauthn.js".

Workaround:
I was able to resolve the issue by adding the following dependencies to the project's package.json:

"@simplewebauthn/browser": "^10.0.0",
"@simplewebauthn/server": "^10.0.1"

Additional context:
Nuxt version: 3.13.2 nuxt-auth-utils version: 0.4.4/0.4.3/0.4.2/0.4.1/0.4.0