Skip to content

Minimal SvelteKit app fails w/ SyntaxError: Identifier 'Temporal' has already been declared #487

@ixxie

Description

@ixxie

Summary

I'm trying to figure out how to build a very minimal test with Fedify + SvelteKit. I found the integration instructions (I assume the code refers to hooks.server.ts but this is not mentioned explicitly).

When I do a minimal setup w/ the SqliteKvStore and InProcessMessageQueue I get an error: SyntaxError: Identifier 'Temporal' has already been declared.

Expected Behavior

No errors, and (maybe) some request logging?

Actual Behavior

When I try to hit http://localhost:5173 I get:

SyntaxError: Identifier 'Temporal' has already been declared
    at compileSourceTextModule (node:internal/modules/esm/utils:346:16)
    at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:107:18)
    at #translate (node:internal/modules/esm/loader:546:20)
    at afterLoad (node:internal/modules/esm/loader:596:29)
    at ModuleLoader.loadAndTranslate (node:internal/modules/esm/loader:601:12)
    at #createModuleJob (node:internal/modules/esm/loader:624:36)
    at #getJobFromResolveResult (node:internal/modules/esm/loader:343:34)
    at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:311:41)

Environment

OS: NixOS
Runtime: bun 1.3.3

Logs / Screenshots

No response

Steps to Reproduce

What I did:

  • Setup a skeleton project w/ bunx sv create
  • Created a hooks.server.ts following the instructions (see below)
  • Navigated to http://localhost:5173

My hooks.server.ts

import { createFederation, InProcessMessageQueue } from '@fedify/fedify';
import { SqliteKvStore } from '@fedify/sqlite';
import { fedifyHook } from '@fedify/sveltekit';

import { Database } from 'bun:sqlite';

const db = new Database(':memory:');

const federation = createFederation<void>({
    kv: new SqliteKvStore(db),
    queue: new InProcessMessageQueue()
});

export const handle = fedifyHook(federation, (req) => {
    console.log(req);
});

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions