atinux / nuxt-auth-utils

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

Cannot access 'renderer$1' before initialization #253

Closed rscorer closed 4 weeks ago

rscorer commented 4 weeks ago

My reproducible case appears to be simple :smile:

Clone nuxt-auth-utils, edit the .env from env.example (inside the playground folder), and then run it.

✗ git clone git@github.com:atinux/nuxt-auth-utils.git
✗ cd nuxt-auth-utils
✗ cp playground/.env.example playground/.env
✗ pnpm dev --port=8012

...

 ERROR  (node:42628) ExperimentalWarning: Support for loading ES Module in require() is an experimental feature and might change at any time          7:01:00 PM
(Use node --trace-warnings ... to show where the warning was created)

...

 ERROR  [nitro] [uncaughtException] defineWebAuthnAuthenticateEventHandler is not defined

  at <anonymous> (playground/server/api/webauthn/authenticate.post.ts:10:1)
  at ModuleJob.run (node:internal/modules/esm/module_job:268:25)
  at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:543:26)
  at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:116:5)

...

ERROR  [nuxt] [request error] [unhandled] [500] Cannot access 'renderer$1' before initialization
  at <anonymous> (./node_modules/.pnpm/@nuxt+icon@1.5.6_magicast@0.3.5_rollup@3.29.4_vite@5.4.6_@types+node@22.5.5_terser@5.33.0__vue@3.5.6_typescript@5.6.3_/node_modules/@nuxt/icon/dist/runtime/server/api.js:66:3)  
  at process.processTicksAndRejections (node:internal/process/task_queues:105:5)  
  at async ./node_modules/.pnpm/h3@1.12.0/node_modules/h3/dist/index.mjs:1975:19  
  at async Object.callAsync (./node_modules/.pnpm/unctx@2.3.1/node_modules/unctx/dist/index.mjs:72:16)  
  at async Server.toNodeHandle (./node_modules/.pnpm/h3@1.12.0/node_modules/h3/dist/index.mjs:2266:7)

...

ERROR  [nuxt] [request error] [unhandled] [500] Cannot access 'renderer$1' before initialization
  at <anonymous> (./node_modules/.pnpm/@nuxt+icon@1.5.6_magicast@0.3.5_rollup@3.29.4_vite@5.4.6_@types+node@22.5.5_terser@5.33.0__vue@3.5.6_typescript@5.6.3_/node_modules/@nuxt/icon/dist/runtime/server/api.js:66:3)  
  at process.processTicksAndRejections (node:internal/process/task_queues:105:5)  
  at async ./node_modules/.pnpm/h3@1.12.0/node_modules/h3/dist/index.mjs:1975:19  
  at async Object.callAsync (./node_modules/.pnpm/unctx@2.3.1/node_modules/unctx/dist/index.mjs:72:16)  
  at async toNodeHandle (./node_modules/.pnpm/h3@1.12.0/node_modules/h3/dist/index.mjs:2266:7)  
  at async ufetch (./node_modules/.pnpm/unenv@1.10.0/node_modules/unenv/runtime/fetch/index.mjs:9:17)  
  at async errorhandler (./node_modules/.pnpm/nuxt@3.13.2_@parcel+watcher@2.4.1_@types+node@22.5.5_eslint@9.13.0_jiti@2.3.3__ioredis@5.4.1__gkblqnvffo4beghho2bdyyubp4/node_modules/nuxt/dist/core/runtime/nitro/error.js:37:41)  
  at async Server.toNodeHandle (./node_modules/.pnpm/h3@1.12.0/node_modules/h3/dist/index.mjs:2274:9)

^C
Process finished with exit code 0
✗ npm --version
10.9.0
✗ node --version
v23.0.0
atinux commented 4 weeks ago

Did you run npm run dev:prepare?

see https://github.com/atinux/nuxt-auth-utils?tab=readme-ov-file#development

rscorer commented 4 weeks ago

No.

I just did, and it works now.

Thanks!