nextauthjs / next-auth

Authentication for the Web.
https://authjs.dev
ISC License
24.15k stars 3.35k forks source link

"Not found" errors in sveltekit-auth-example with adapter-node #9084

Closed DePasqualeOrg closed 7 months ago

DePasqualeOrg commented 10 months ago

Environment

System: OS: macOS 14.1 CPU: (8) x64 Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz Memory: 27.82 MB / 16.00 GB Shell: 5.2.15 - /usr/local/bin/bash Binaries: Node: 20.8.0 - ~/.node-path/node npm: 10.2.0 - ~/.node-path/npm pnpm: 8.9.0 - /usr/local/bin/pnpm bun: 1.0.6 - /usr/local/bin/bun Browsers: Chrome: 119.0.6045.105 Safari: 17.1

npmPackages: @auth/core: latest => 0.18.0 @auth/prisma-adapter: ^1.0.5 => 1.0.5 @auth/sveltekit: latest => 0.3.11

Reproduction URL

https://github.com/nextauthjs/sveltekit-auth-example

Describe the issue

When running sveltekit-auth-example with SvelteKit's adapter-node, I get multiple "not found" errors when redirected to the default login pages, such as /auth/signin. The pages appear to render correctly. Here is an example of the errors:

Error: Not found: /auth/_app/immutable/assets/0.d8b38efe.css
    at resolve (file:///<redacted>/next-auth-sveltekit-example/.svelte-kit/output/server/index.js:2851:18)
    at resolve (file:///<redacted>/next-auth-sveltekit-example/.svelte-kit/output/server/index.js:2678:34)
    at Object.handle (file:///<redacted>/next-auth-sveltekit-example/.svelte-kit/output/server/chunks/hooks.server.js:42:14)
    at respond (file:///<redacted>/next-auth-sveltekit-example/.svelte-kit/output/server/index.js:2676:43)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Error: Not found: /auth/_app/immutable/chunks/scheduler.e108d1fd.js
    at resolve (file:///<redacted>/next-auth-sveltekit-example/.svelte-kit/output/server/index.js:2851:18)
    at resolve (file:///<redacted>/next-auth-sveltekit-example/.svelte-kit/output/server/index.js:2678:34)
    at Object.handle (file:///<redacted>/next-auth-sveltekit-example/.svelte-kit/output/server/chunks/hooks.server.js:42:14)
    at respond (file:///<redacted>/next-auth-sveltekit-example/.svelte-kit/output/server/index.js:2676:43)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Error: Not found: /auth/_app/immutable/entry/start.ad846d94.js
    at resolve (file:///<redacted>/next-auth-sveltekit-example/.svelte-kit/output/server/index.js:2851:18)
    at resolve (file:///<redacted>/next-auth-sveltekit-example/.svelte-kit/output/server/index.js:2678:34)
    at Object.handle (file:///<redacted>/next-auth-sveltekit-example/.svelte-kit/output/server/chunks/hooks.server.js:42:14)
    at respond (file:///<redacted>/next-auth-sveltekit-example/.svelte-kit/output/server/index.js:2676:43)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Error: Not found: /auth/_app/immutable/chunks/singletons.cf7d7955.js
    at resolve (file:///<redacted>/next-auth-sveltekit-example/.svelte-kit/output/server/index.js:2851:18)
    at resolve (file:///<redacted>/next-auth-sveltekit-example/.svelte-kit/output/server/index.js:2678:34)
    at Object.handle (file:///<redacted>/next-auth-sveltekit-example/.svelte-kit/output/server/chunks/hooks.server.js:42:14)
    at respond (file:///<redacted>/next-auth-sveltekit-example/.svelte-kit/output/server/index.js:2676:43)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Error: Not found: /auth/_app/immutable/entry/app.212bdfac.js
    at resolve (file:///<redacted>/next-auth-sveltekit-example/.svelte-kit/output/server/index.js:2851:18)
    at resolve (file:///<redacted>/next-auth-sveltekit-example/.svelte-kit/output/server/index.js:2678:34)
    at Object.handle (file:///<redacted>/next-auth-sveltekit-example/.svelte-kit/output/server/chunks/hooks.server.js:42:14)
    at respond (file:///<redacted>/next-auth-sveltekit-example/.svelte-kit/output/server/index.js:2676:43)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Error: Not found: /auth/_app/immutable/chunks/index.5cee8edd.js
    at resolve (file:///<redacted>/next-auth-sveltekit-example/.svelte-kit/output/server/index.js:2851:18)
    at resolve (file:///<redacted>/next-auth-sveltekit-example/.svelte-kit/output/server/index.js:2678:34)
    at Object.handle (file:///<redacted>/next-auth-sveltekit-example/.svelte-kit/output/server/chunks/hooks.server.js:42:14)
    at respond (file:///<redacted>/next-auth-sveltekit-example/.svelte-kit/output/server/index.js:2676:43)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Error: Not found: /auth/_app/immutable/nodes/0.72a3220a.js
    at resolve (file:///<redacted>/next-auth-sveltekit-example/.svelte-kit/output/server/index.js:2851:18)
    at resolve (file:///<redacted>/next-auth-sveltekit-example/.svelte-kit/output/server/index.js:2678:34)
    at Object.handle (file:///<redacted>/next-auth-sveltekit-example/.svelte-kit/output/server/chunks/hooks.server.js:42:14)
    at respond (file:///<redacted>/next-auth-sveltekit-example/.svelte-kit/output/server/index.js:2676:43)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Error: Not found: /auth/_app/immutable/chunks/stores.683aa623.js
    at resolve (file:///<redacted>/next-auth-sveltekit-example/.svelte-kit/output/server/index.js:2851:18)
    at resolve (file:///<redacted>/next-auth-sveltekit-example/.svelte-kit/output/server/index.js:2678:34)
    at Object.handle (file:///<redacted>/next-auth-sveltekit-example/.svelte-kit/output/server/chunks/hooks.server.js:42:14)
    at respond (file:///<redacted>/next-auth-sveltekit-example/.svelte-kit/output/server/index.js:2676:43)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Error: Not found: /auth/_app/immutable/nodes/1.610b1e39.js
    at resolve (file:///<redacted>/next-auth-sveltekit-example/.svelte-kit/output/server/index.js:2851:18)
    at resolve (file:///<redacted>/next-auth-sveltekit-example/.svelte-kit/output/server/index.js:2678:34)
    at Object.handle (file:///<redacted>/next-auth-sveltekit-example/.svelte-kit/output/server/chunks/hooks.server.js:42:14)
    at respond (file:///<redacted>/next-auth-sveltekit-example/.svelte-kit/output/server/index.js:2676:43)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

How to reproduce

npm run build
npm run preview

Use adapter-node instead of adapter-auto in svelte.config.js:

import adapter from '@sveltejs/adapter-node';
import { vitePreprocess } from '@sveltejs/kit/vite';

const config = {
    preprocess: vitePreprocess(),
    kit: {
        adapter: adapter({ out: 'build' }),
    },
};

export default config;

Expected behavior

No errors on default login/logout pages

balazsorban44 commented 7 months ago

We could not detect a valid reproduction link. Make sure to follow the bug report template carefully.

Why was this issue closed?

To be able to investigate, we need access to a reproduction to identify what triggered the issue. We need a link to a public GitHub repository. Example: (NextAuth.js example repository).

The bug template that you filled out has a section called "Reproduction URL", which is where you should provide the link to the reproduction.

What should I do?

Depending on the reason the issue was closed, you can do the following:

In general, assume that we should not go through a lengthy onboarding process at your company code only to be able to verify an issue.

My repository is private and cannot make it public

In most cases, a private repo will not be a sufficient minimal reproduction, as this codebase might contain a lot of unrelated parts that would make our investigation take longer. Please do not make it public. Instead, create a new repository using the templates above, adding the relevant code to reproduce the issue. Common things to look out for:

I did not open this issue, but it is relevant to me, what can I do to help?

Anyone experiencing the same issue is welcome to provide a minimal reproduction following the above steps by opening a new issue.

I think my reproduction is good enough, why aren't you looking into it quickly?

We look into every issue and monitor open issues for new comments.

However, sometimes we might miss a few due to the popularity/high traffic of the repository. We apologize, and kindly ask you to refrain from tagging core maintainers, as that will usually not result in increased priority.

Upvoting issues to show your interest will help us prioritize and address them as quickly as possible. That said, every issue is important to us, and if an issue gets closed by accident, we encourage you to open a new one linking to the old issue and we will look into it.

Useful Resources