Open its-jman opened 9 months ago
I've narrowed it down: injectEndpoints: false
no longer errors, which makes sense since that code calls path.dirname
and path.join
, although that code is not included in the built file.
This is the first few lines of the built file that seems to be causing issues.
./dist/$server_build/chunks/pages/{hash}.mjs
:
import 'path';
import { Auth } from '@auth/core';
import { splitCookiesString, parseString } from 'set-cookie-parser';
import { serialize } from 'cookie';
import Google from '@auth/core/providers/google';
const defineConfig = (config) => {
config.prefix ??= "/api/auth";
return config;
};
const authConfig = defineConfig({
trustHost: true,
secret: "1234",
providers: [
Google({
clientId: "1234",
clientSecret: "1234"
})
]
});
Repro: https://github.com/its-jman/auth-astro-repro
When running
astro build
withauth()
included as an integration, the build fails sayingThe package "path" wasn't found on the file system...
.There seems to be a
import "path";
injected at the beginning of the build output which causes this errorIf you have ideas I'm happy to investigate further, but I haven't found any solutions so far.
astro.config.mjs
: