Skip to content

Instructions for astro-auth results in build error #12271

@thdoan

Description

@thdoan

📚 Subject area/topic

astro-auth

📋 Page(s) affected (or suggested, for new content)

https://docs.astro.build/en/guides/authentication/#authjs

📋 Description of content that is out-of-date or incorrect

The instructions results in this build error:

❯ npm run build

> @example/[email protected] build
> astro build

16:55:51 [ERROR] [astro-auth] No Adapter found, please make sure you provide one in your Astro config
16:55:51 [ERROR] [astro-auth] An unhandled error occurred while running the "astro:config:setup" hook
Cannot read properties of undefined (reading 'name')
  Location:
    /home/projects/withastro-astro-ewbcra9m/node_modules/auth-astro/src/integration.ts:35:29
  Stack trace:
    at astro:config:setup (/home/projects/withastro-astro-ewbcra9m/node_modules/auth-astro/src/integration.ts:35:29)
    at withTakingALongTimeMsg (file:///home/projects/withastro-astro-ewbcra9m/node_modules/astro/dist/integrations/hooks.js:62:18)
    at Module.runHookConfigSetup (file:///home/projects/withastro-astro-ewbcra9m/node_modules/astro/dist/integrations/hooks.js:171:41)
    at async AstroBuilder.run (file:///home/projects/withastro-astro-ewbcra9m/node_modules/astro/dist/core/build/index.js:198:23)
    at async build (file:///home/projects/withastro-astro-ewbcra9m/node_modules/astro/dist/cli/build/index.js:44:3)

It seems the instructions are missing a number of additional steps or requirements that must be met first, in which case it should be pointed out in the document.

🖥️ Reproduction in StackBlitz (if reporting incorrect content or code samples)

  1. Go to https://stackblitz.com/edit/withastro-astro-ewbcra9m?file=auth.config.ts
  2. Execute npm run build in terminal

Metadata

Metadata

Assignees

No one assigned

    Labels

    improve or update documentationEnhance / update existing documentation (e.g. add example, improve description, update for changes)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions