[BUG] should use ESM instead of CJS #948

Closed
opened 2026-02-04 23:41:34 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @uhthomas on GitHub (Jun 15, 2023).

The bug

Immich currently uses Common JS, which causes some subtle issues. The general recommendation is to use ES modules where possible.

This guide looks helpful.

Specifically this would allow using import statements consistently, rather than the strange import() function like was required for #2649.

import { rgbaToThumbHash } from 'thumbhash';

// versus

const thumbhash = await import('thumbhash');

The OS that Immich Server is running on

N/A

Version of Immich Server

N/A

Version of Immich Mobile App

N/A

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

N/A

Your .env content

N/A

Reproduction steps

N/A

Additional information

No response

Originally created by @uhthomas on GitHub (Jun 15, 2023). ### The bug Immich currently uses Common JS, which causes some subtle issues. The general recommendation is to use ES modules where possible. [This guide](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c) looks helpful. Specifically this would allow using import statements consistently, rather than the strange `import()` function like was required for #2649. ```ts import { rgbaToThumbHash } from 'thumbhash'; // versus const thumbhash = await import('thumbhash'); ``` ### The OS that Immich Server is running on N/A ### Version of Immich Server N/A ### Version of Immich Mobile App N/A ### Platform with the issue - [X] Server - [X] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML N/A ``` ### Your .env content ```Shell N/A ``` ### Reproduction steps ```bash N/A ``` ### Additional information _No response_
OVERLORD added the 🗄️server label 2026-02-04 23:41:34 +03:00
Author
Owner

@jrasm91 commented on GitHub (Jul 2, 2024):

This is a technical implementation detail with a lot of caveats. At the moment there is no plan to run the server as ESM.

@jrasm91 commented on GitHub (Jul 2, 2024): This is a technical implementation detail with a lot of caveats. At the moment there is no plan to run the server as ESM.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#948