Skip to content

First install error

Hi, I'm very not used to node or rust or even bun but I almost did it to work, I'll paste my actions below.

In any case, at the end when I finally have something on the server and I got this error

[vite] (ssr) Error when evaluating SSR module /src/routes/+layout.server.ts: Missing "./providers/google" specifier in "@auth/sveltekit" package
  Plugin: vite:import-analysis
  File: /home/deploy/fuiz/website/src/auth.ts:5:19
  2  |  import { D1Adapter } from "@auth/d1-adapter";
  3  |  import { SvelteKitAuth } from "@auth/sveltekit";
  4  |  import google from "@auth/sveltekit/providers/google";
     |                      ^
  5  |  const providers = (env.AUTH_GOOGLE_ID?.length ?? 0) > 0 && (env.AUTH_GOOGLE_SECRET?.length ?? 0) > 0 ? [
  6  |    google({
      at e (file:///home/deploy/fuiz/website/node_modules/vite/dist/node/chunks/dep-Pj_jxEzN.js:15559:25)
      at n (file:///home/deploy/fuiz/website/node_modules/vite/dist/node/chunks/dep-Pj_jxEzN.js:15559:631)
      at o (file:///home/deploy/fuiz/website/node_modules/vite/dist/node/chunks/dep-Pj_jxEzN.js:15559:1293)
      at resolveExportsOrImports (file:///home/deploy/fuiz/website/node_modules/vite/dist/node/chunks/dep-Pj_jxEzN.js:19569:18)
      at resolveDeepImport (file:///home/deploy/fuiz/website/node_modules/vite/dist/node/chunks/dep-Pj_jxEzN.js:19582:25)
      at tryNodeResolve (file:///home/deploy/fuiz/website/node_modules/vite/dist/node/chunks/dep-Pj_jxEzN.js:19412:18)
      at ResolveIdContext.resolveId (file:///home/deploy/fuiz/website/node_modules/vite/dist/node/chunks/dep-Pj_jxEzN.js:19185:19)
      at EnvironmentPluginContainer.resolveId (file:///home/deploy/fuiz/website/node_modules/vite/dist/node/chunks/dep-Pj_jxEzN.js:47603:17)
      at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
      at async TransformPluginContext.resolve (file:///home/deploy/fuiz/website/node_modules/vite/dist/node/chunks/dep-Pj_jxEzN.js:47806:15)
Error: Missing "./providers/google" specifier in "@auth/sveltekit" package
    at e (file:///home/deploy/fuiz/website/node_modules/vite/dist/node/chunks/dep-Pj_jxEzN.js:15559:25)
    at n (file:///home/deploy/fuiz/website/node_modules/vite/dist/node/chunks/dep-Pj_jxEzN.js:15559:631)
    at o (file:///home/deploy/fuiz/website/node_modules/vite/dist/node/chunks/dep-Pj_jxEzN.js:15559:1293)
    at resolveExportsOrImports (file:///home/deploy/fuiz/website/node_modules/vite/dist/node/chunks/dep-Pj_jxEzN.js:19569:18)
    at resolveDeepImport (file:///home/deploy/fuiz/website/node_modules/vite/dist/node/chunks/dep-Pj_jxEzN.js:19582:25)
    at tryNodeResolve (file:///home/deploy/fuiz/website/node_modules/vite/dist/node/chunks/dep-Pj_jxEzN.js:19412:18)
    at ResolveIdContext.resolveId (file:///home/deploy/fuiz/website/node_modules/vite/dist/node/chunks/dep-Pj_jxEzN.js:19185:19)
    at EnvironmentPluginContainer.resolveId (file:///home/deploy/fuiz/website/node_modules/vite/dist/node/chunks/dep-Pj_jxEzN.js:47603:17)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async TransformPluginContext.resolve (file:///home/deploy/fuiz/website/node_modules/vite/dist/node/chunks/dep-Pj_jxEzN.js:47806:15) {
  pos: 159,
  plugin: 'vite:import-analysis',
  id: '/home/deploy/fuiz/website/src/auth.ts',
  pluginCode: 'import { env } from "$env/dynamic/private";\n' +
    'import { D1Adapter } from "@auth/d1-adapter";\n' +
    'import { SvelteKitAuth } from "@auth/sveltekit";\n' +
    'import google from "@auth/sveltekit/providers/google";\n' +
    'const providers = (env.AUTH_GOOGLE_ID?.length ?? 0) > 0 && (env.AUTH_GOOGLE_SECRET?.length ?? 0) > 0 ? [\n' +
    '  google({\n' +
    '    clientId: env.AUTH_GOOGLE_ID,\n' +
    '    clientSecret: env.AUTH_GOOGLE_SECRET,\n' +
    '    authorization: {\n' +
    '      params: {\n' +
    '        prompt: "consent",\n' +
    '        access_type: "offline",\n' +
    '        response_type: "code"\n' +
    '      }\n' +
    '    }\n' +
    '  })\n' +
    '] : [];\n' +
    'export const providerMap = providers.map((provider) => {\n' +
    '  if (typeof provider === "function") {\n' +
    '    const providerData = provider();\n' +
    '    return { id: providerData.id, name: providerData.name };\n' +
    '  } else {\n' +
    '    return { id: provider.id, name: provider.name };\n' +
    '  }\n' +
    '});\n' +
    'export const { handle } = SvelteKitAuth(async (event) => ({\n' +
    '  providers,\n' +
    '  trustHost: true,\n' +
    '  secret: env.AUTH_SECRET,\n' +
    '  adapter: D1Adapter(event.platform?.env.DATABASE),\n' +
    '  callbacks: {\n' +
    '    session({ session, user }) {\n' +
    '      session.user.id = user.id;\n' +
    '      return session;\n' +
    '    }\n' +
    '  },\n' +
    '  pages: {\n' +
    '    signIn: "/signin"\n' +
    '  }\n' +
    '}));\n',
  loc: {
    file: '/home/deploy/fuiz/website/src/auth.ts',
    line: 5,
    column: 19
  },
  frame: '2  |  import { D1Adapter } from "@auth/d1-adapter";\n' +
    '3  |  import { SvelteKitAuth } from "@auth/sveltekit";\n' +
    '4  |  import google from "@auth/sveltekit/providers/google";\n' +
    '   |                      ^\n' +
    '5  |  const providers = (env.AUTH_GOOGLE_ID?.length ?? 0) > 0 && (env.AUTH_GOOGLE_SECRET?.length ?? 0) > 0 ? [\n' +
    '6  |    google({',
  runnerError: Error: RunnerError
      at reviveInvokeError (file:///home/deploy/fuiz/website/node_modules/vite/dist/node/module-runner.js:541:18)
      at Object.invoke (file:///home/deploy/fuiz/website/node_modules/vite/dist/node/module-runner.js:624:15)
      at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
      at async SSRCompatModuleRunner.getModuleInformation (file:///home/deploy/fuiz/website/node_modules/vite/dist/node/module-runner.js:1192:73)
      at async request (file:///home/deploy/fuiz/website/node_modules/vite/dist/node/module-runner.js:1214:88)
      at async eval (/home/deploy/fuiz/website/src/routes/+layout.server.ts:3:44)
      at async ESModulesEvaluator.runInlinedModule (file:///home/deploy/fuiz/website/node_modules/vite/dist/node/module-runner.js:1049:5)
      at async SSRCompatModuleRunner.directRequest (file:///home/deploy/fuiz/website/node_modules/vite/dist/node/module-runner.js:1271:61)
      at async SSRCompatModuleRunner.directRequest (file:///home/deploy/fuiz/website/node_modules/vite/dist/node/chunks/dep-Pj_jxEzN.js:30916:23)
      at async SSRCompatModuleRunner.cachedRequest (file:///home/deploy/fuiz/website/node_modules/vite/dist/node/module-runner.js:1167:76)
}


My note about how to make it happen without compiling error

install curl git unzip
mkdir \~/fuiz

https://nodejs.org/en/download
* curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.2/install.sh | bash
* \\. "$HOME/.nvm/nvm.sh"
* nvm install 22

https://bun.sh/docs/installation
* npm install -g bun

https://www.rust-lang.org/tools/install
* curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

git clone https://gitlab.com/fuiz/corkboard
cd corkboard/
cargo run &

cd \~/fuiz
git clone https://gitlab.com/fuiz/hosted-server
cd hosted-server/

cargo run &
cd \~/fuiz
git clone https://gitlab.com/fuiz/website

cd website/
npm install

*  folder architecture
  *  ~/fuiz
    *  corckboard
    *  hosted-server
    *  website

*  Create .env.local inside website (should be the current directory now) with:

openssl rand -base64 24

AUTH_SECRET={paste result of last command}
PUBLIC_DISPLAY_PLAY_URL="127.0.0.1:5173"
PUBLIC_PLAY_URL="[http://127.0.0.1:5173](http://127.0.0.1:5173)"
PUBLIC_BACKEND_URL="[http://127.0.0.1:8080](http://127.0.0.1:8080)"
PUBLIC_WS_URL="ws://127.0.0.1:8080"
PUBLIC_CORKBOARD_URL="[http://127.0.0.1:5040](http://127.0.0.1:5040)"

bun run dev --host