Skip to content

Unable to run the template #1

@santiemanuel

Description

@santiemanuel

Hello OtterLord,

I tried creating a project from this template both from GitHub and from your command (I guess it's the same), but so far wasn't able to run properly.

This is the message with the default config:

17:13:44 [200] / 27ms
17:13:45 [200] /auth/signin 2ms
17:13:45 [200] /auth/signin 1ms
17:13:46 [302] POST /auth/signin/github 5ms
17:13:47 [WARN] [router] A `getStaticPaths()` route pattern was matched, but no matching static path was found for requested path `/login/github/callback`.

Possible dynamic routes being matched: node_modules/.pnpm/@astrojs+starlight@0.21.5_astro@4.5.17/node_modules/@astrojs/starlight/index.astro.       
17:13:47 [404] /login/github/callback 6ms

I used pnpm to install depedencies because it seems npm isn't set up.

Then I tried using node as adapter, The result is similar:

Not sure if this is correct in the middleware file: import { next, rewrite } from '@astrojs/node'

Same output:

17:18:20 watching for file changes...
17:18:24 [200] / 24ms
17:18:25 [200] /auth/signin 2ms
17:18:26 [200] /auth/signin 1ms
17:18:27 [302] POST /auth/signin/github 5ms
17:18:27 [WARN] [router] A `getStaticPaths()` route pattern was matched, but no matching static path was found for requested path `/login/github/callback`.

Possible dynamic routes being matched: node_modules/.pnpm/@astrojs+starlight@0.21.5_astro@4.5.17/node_modules/@astrojs/starlight/index.astro.       
17:18:27 [404] /login/github/callback 5ms

Using the ts pnpm I've read by you somewhere in the Discord server gives me this:

PS C:\astro-projects\gh-auth-progadv> pnpm tsm .\src\server\index.ts
(node:119200) ExperimentalWarning: `--experimental-loader` may be removed in the future; instead use `register()`:
--import 'data:text/javascript,import { register } from "node:module"; import { pathToFileURL } from "node:url"; register("file%3A///C%3A/astro-projects/gh-auth-progadv/node_modules/.pnpm/tsm%402.3.0/node_modules/tsm/loader.mjs", pathToFileURL("./"));'
(Use `node --trace-warnings ...` to show where the warning was created)
node:fs:453
    return binding.readFileUtf8(path, stringToFlags(options.flag));
                   ^

Error: ENOENT: no such file or directory, open 'C:\C:\astro-projects\gh-auth-progadv\dist\client\404.html'
    at Object.readFileSync (node:fs:453:20)
    at <anonymous> (c:\astro-projects\gh-auth-progadv\src\server\index.ts:16:25)
    at ModuleJob.run (node:internal/modules/esm/module_job:218:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
    at async loadESM (node:internal/process/esm_loader:28:7)
    at async handleMainPromise (node:internal/modules/run_main:113:12) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'open',
  path: 'C:\\C:\\astro-projects\\gh-auth-progadv\\dist\\client\\404.html'
}

Node.js v20.11.1

I set up the env file, the only thing I have doubts is the AUTH_SECRET key which I think should be different, I used the same as GITHUB_CLIENT_SECRET but I'm not sure if it'd affect.

Those are the only changes I've made to the project, but it fails when I press the GitHub login button.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions