[possible BUG?] "SyntaxError: Named export 'AxiosError' not found." in immich-web / docker-compose #142

Closed
opened 2026-02-04 18:07:19 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @Cantello on GitHub (Jul 13, 2022).

Describe the bug
After updating the docker images from 1.15 to 1.17 without changing anything in docker-compose.yml, the above error shows in immich-web's logs and it keeps on looping the same errors. Connecting to the server results in a 502/Bad Gateway error.

Task List

  • I have read thoroughly the README setup and installation instructions.
  • If my setup is different, I have included my docker-compose file.
  • I have included my redacted .env file.
  • I have included information on my machine, and environment.

Expected behavior
Immich-web would accept connections.

Desktop (please complete the following information):

  • OS: ubuntu server 20.04

Additional context

Docker-compose.yml snippet
  immich-server:
    container_name: immich-server
    image: altran1502/immich-server:latest
    entrypoint: ["/bin/sh", "./start-server.sh"]
    env_file:
      - /opt/immich/.env
    environment:
      - NODE_ENV=production
    volumes:
      - /mnt/Photos/immich:/usr/src/app/upload
    depends_on:
      - immich_redis
      - immich_postgres
    restart: always

  immich-microservices:
    container_name: immich-microservices
    image: altran1502/immich-server:latest
    entrypoint: ["/bin/sh", "./start-microservices.sh"]
    volumes:
      - /mnt/Photos/immich:/usr/src/app/upload
    env_file:
      - /opt/immich/.env
    environment:
      - NODE_ENV=production
    depends_on:
      - immich_redis
      - immich_postgres
    restart: always

  immich-machine-learning:
    container_name: immich-machine-learning
    image: altran1502/immich-machine-learning:latest
    entrypoint: ["/bin/sh", "./entrypoint.sh"]
    volumes:
      - /mnt/Photos/immich:/usr/src/app/upload
    env_file:
      - /opt/immich/.env
    environment:
      - NODE_ENV=production
    depends_on:
      - immich_postgres

  immich-web:
    container_name: immich-web
    image: altran1502/immich-web:latest
    entrypoint: ["/bin/sh", "./entrypoint.sh"]
    env_file:
      - /opt/immich/.env
    restart: always

  immich_redis:
    container_name: immich_redis
    image: redis:6.2
    restart: always

  immich_postgres:
    container_name: immich_postgres
    image: postgres:14
    env_file:
      - /opt/immich/.env
    environment:
      POSTGRES_PASSWORD: postgres
      POSTGRES_USER: postgres
      POSTGRES_DB: immich
      PG_DATA: /var/lib/postgresql/data
    volumes:
      - /opt/immich/database/pgdata:/var/lib/postgresql/data
    restart: always

  immich-proxy:
    container_name: immich_proxy
    image: altran1502/immich-proxy:release
    ports:
      - 2283:80
      - 2284:443
    logging:
      driver: none
    depends_on:
      - immich-server
    restart: always
redacted .env-file
###################################################################################
# Database
###################################################################################
DB_HOSTNAME=immich_postgres
DB_USERNAME=postgres
DB_PASSWORD=postgres
DB_DATABASE_NAME=immich
###################################################################################
# Redis
###################################################################################
REDIS_HOSTNAME=immich_redis
# Optional Redis settings:
# REDIS_PORT=6379
# REDIS_DBINDEX=0
# REDIS_PASSWORD=
# REDIS_SOCKET=
###################################################################################
# Upload File Config
###################################################################################
UPLOAD_LOCATION=/opt/immich/upload
###################################################################################
# JWT SECRET
###################################################################################
JWT_SECRET=randomstringthatissolongandpowerfulthatnoonecanguess
###################################################################################
# MAPBOX
####################################################################################
# ENABLE_MAPBOX is either true of false -> if true, you have to provide MAPBOX_KEY
ENABLE_MAPBOX=false
MAPBOX_KEY=
###################################################################################
# WEB - Required
###################################################################################
# This is the URL of your vm/server where you host Immich, so that the web frontend
# know where can it make the request to.
# For example: If your server IP address is 10.1.11.50, the environment variable will
# be VITE_SERVER_ENDPOINT=http://10.1.11.50:2283/api
# !CAUTION! THERE IS NO FORWARD SLASH AT THE END
VITE_SERVER_ENDPOINT=http://192.168.1.12:2283/api
VITE_LOGIN_PAGE_MESSAGE=
immich-web logs
> web@0.0.1 build
> svelte-kit build
vite v2.9.8 building for production...
transforming...
✓ 801 modules transformed.
rendering chunks...
.svelte-kit/output/client/_app/manifest.json                                         6.18 KiB
.svelte-kit/output/client/_app/pages/__layout.svelte-eef758d9.js                     20.99 KiB / gzip: 7.66 KiB
.svelte-kit/output/client/_app/error.svelte-77365d18.js                              1.56 KiB / gzip: 0.75 KiB
.svelte-kit/output/client/_app/start-215867cf.js                                     24.75 KiB / gzip: 8.75 KiB
.svelte-kit/output/client/_app/pages/admin/index.svelte-b1dd64f5.js                  16.67 KiB / gzip: 5.88 KiB
.svelte-kit/output/client/_app/pages/auth/change-password/index.svelte-b9ca3cf0.js   6.75 KiB / gzip: 2.87 KiB
.svelte-kit/output/client/_app/pages/auth/login/index.svelte-e690dfcc.js             4.68 KiB / gzip: 2.06 KiB
.svelte-kit/output/client/_app/pages/auth/register/index.svelte-7bfa795e.js          7.34 KiB / gzip: 2.86 KiB
.svelte-kit/output/client/_app/pages/index.svelte-6ab063bc.js                        2.30 KiB / gzip: 1.18 KiB
.svelte-kit/output/client/_app/pages/photos/_assetId_.svelte-1c414347.js             0.28 KiB / gzip: 0.22 KiB
.svelte-kit/output/client/_app/chunks/index-ef4af6b9.js                              12.54 KiB / gzip: 5.21 KiB
.svelte-kit/output/client/_app/chunks/index-5bce63e4.js                              0.79 KiB / gzip: 0.49 KiB
.svelte-kit/output/client/_app/chunks/singletons-d1fb5791.js                         0.05 KiB / gzip: 0.07 KiB
.svelte-kit/output/client/_app/chunks/preload-helper-e4860ae8.js                     0.55 KiB / gzip: 0.39 KiB
.svelte-kit/output/client/_app/chunks/index-671921bc.js                              1.76 KiB / gzip: 0.66 KiB
.svelte-kit/output/client/_app/chunks/api-09a5d632.js                                40.01 KiB / gzip: 10.18 KiB
.svelte-kit/output/client/_app/chunks/navigation-0e6511d1.js                         0.17 KiB / gzip: 0.15 KiB
.svelte-kit/output/client/_app/chunks/full-screen-modal-f787b1df.js                  1.22 KiB / gzip: 0.75 KiB
.svelte-kit/output/client/_app/chunks/stores-3c8b13ca.js                             0.60 KiB / gzip: 0.32 KiB
.svelte-kit/output/client/_app/chunks/click-outside-53cfcece.js                      0.21 KiB / gzip: 0.16 KiB
.svelte-kit/output/client/_app/chunks/auth-api-9c6b9414.js                           0.43 KiB / gzip: 0.16 KiB
.svelte-kit/output/client/_app/chunks/status-box-6772cf80.js                         21.28 KiB / gzip: 7.35 KiB
.svelte-kit/output/client/_app/assets/pages/photos/index.svelte-5f6f7bc6.css         0.21 KiB / gzip: 0.18 KiB
.svelte-kit/output/client/_app/assets/pages/__layout.svelte-9e4ac4ac.css             17.84 KiB / gzip: 4.41 KiB
.svelte-kit/output/client/_app/pages/photos/index.svelte-234b1729.js                 128.66 KiB / gzip: 41.12 KiB
.svelte-kit/output/client/_app/chunks/leaflet-src-3bf39228.js                        142.61 KiB / gzip: 41.34 KiB
.svelte-kit/output/client/_app/chunks/assets-f83676e2.js                             217.73 KiB / gzip: 75.52 KiB
vite v2.9.8 building SSR bundle for production...
transforming...
✓ 94 modules transformed.
rendering chunks...
.svelte-kit/output/server/manifest.json                                        4.47 KiB
.svelte-kit/output/server/index.js                                             75.63 KiB
.svelte-kit/output/server/entries/endpoints/auth/logout.ts.js                  0.20 KiB
.svelte-kit/output/server/entries/endpoints/auth/change-password/index.ts.js   0.72 KiB
.svelte-kit/output/server/entries/endpoints/auth/login/index.ts.js             1.40 KiB
.svelte-kit/output/server/entries/endpoints/auth/register/index.ts.js          0.77 KiB
.svelte-kit/output/server/entries/endpoints/admin/api/create-user.ts.js        0.76 KiB
.svelte-kit/output/server/entries/pages/__layout.svelte.js                     8.35 KiB
.svelte-kit/output/server/entries/fallbacks/error.svelte.js                    0.72 KiB
.svelte-kit/output/server/entries/pages/admin/index.svelte.js                  6.53 KiB
.svelte-kit/output/server/entries/pages/auth/change-password/index.svelte.js   3.27 KiB
.svelte-kit/output/server/entries/pages/auth/login/index.svelte.js             1.93 KiB
.svelte-kit/output/server/entries/pages/auth/register/index.svelte.js          3.36 KiB
.svelte-kit/output/server/entries/pages/index.svelte.js                        1.57 KiB
.svelte-kit/output/server/entries/pages/photos/_assetId_.svelte.js             0.42 KiB
.svelte-kit/output/server/entries/pages/photos/index.svelte.js                 11.02 KiB
.svelte-kit/output/server/chunks/index-ab6b5b88.js                             4.26 KiB
.svelte-kit/output/server/chunks/api-b55d1334.js                               63.01 KiB
.svelte-kit/output/server/chunks/assets-381617f7.js                            5.00 KiB
.svelte-kit/output/server/chunks/stores-4ada7be4.js                            0.92 KiB
.svelte-kit/output/server/chunks/status-box-3a3fccf6.js                        11.80 KiB
.svelte-kit/output/server/chunks/hooks-fc354f95.js                             1.31 KiB
file:///usr/src/app/.svelte-kit/output/server/chunks/hooks-fc354f95.js:2
import { AxiosError } from "axios";
         ^^^^^^^^^^
SyntaxError: Named export 'AxiosError' not found. The requested module 'axios' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from 'axios';
const { AxiosError } = pkg;
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:128:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:194:5)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:385:24)
    at async Server.respond (file:///usr/src/app/.svelte-kit/output/server/index.js:2317:22)
    at async visit (file:///usr/src/app/node_modules/@sveltejs/kit/dist/chunks/index2.js:1085:20)

Anything else I could provide to diagnose this? Probably just an oversight on my part but I cannot find what I did differently from before while not changing anything.... stumped.

Originally created by @Cantello on GitHub (Jul 13, 2022). **Describe the bug** After updating the docker images from 1.15 to 1.17 without changing anything in docker-compose.yml, the above error shows in immich-web's logs and it keeps on looping the same errors. Connecting to the server results in a 502/Bad Gateway error. **Task List** - [x] I have read thoroughly the README setup and installation instructions. - [x] If my setup is different, I have included my docker-compose file. - [x] I have included my redacted `.env` file. - [x] I have included information on my machine, and environment. **Expected behavior** Immich-web would accept connections. **Desktop (please complete the following information):** - OS: ubuntu server 20.04 **Additional context** <details> <summary>Docker-compose.yml snippet</summary> ```YAML immich-server: container_name: immich-server image: altran1502/immich-server:latest entrypoint: ["/bin/sh", "./start-server.sh"] env_file: - /opt/immich/.env environment: - NODE_ENV=production volumes: - /mnt/Photos/immich:/usr/src/app/upload depends_on: - immich_redis - immich_postgres restart: always immich-microservices: container_name: immich-microservices image: altran1502/immich-server:latest entrypoint: ["/bin/sh", "./start-microservices.sh"] volumes: - /mnt/Photos/immich:/usr/src/app/upload env_file: - /opt/immich/.env environment: - NODE_ENV=production depends_on: - immich_redis - immich_postgres restart: always immich-machine-learning: container_name: immich-machine-learning image: altran1502/immich-machine-learning:latest entrypoint: ["/bin/sh", "./entrypoint.sh"] volumes: - /mnt/Photos/immich:/usr/src/app/upload env_file: - /opt/immich/.env environment: - NODE_ENV=production depends_on: - immich_postgres immich-web: container_name: immich-web image: altran1502/immich-web:latest entrypoint: ["/bin/sh", "./entrypoint.sh"] env_file: - /opt/immich/.env restart: always immich_redis: container_name: immich_redis image: redis:6.2 restart: always immich_postgres: container_name: immich_postgres image: postgres:14 env_file: - /opt/immich/.env environment: POSTGRES_PASSWORD: postgres POSTGRES_USER: postgres POSTGRES_DB: immich PG_DATA: /var/lib/postgresql/data volumes: - /opt/immich/database/pgdata:/var/lib/postgresql/data restart: always immich-proxy: container_name: immich_proxy image: altran1502/immich-proxy:release ports: - 2283:80 - 2284:443 logging: driver: none depends_on: - immich-server restart: always ``` </details> <details> <summary>redacted .env-file</summary> ``` ################################################################################### # Database ################################################################################### DB_HOSTNAME=immich_postgres DB_USERNAME=postgres DB_PASSWORD=postgres DB_DATABASE_NAME=immich ################################################################################### # Redis ################################################################################### REDIS_HOSTNAME=immich_redis # Optional Redis settings: # REDIS_PORT=6379 # REDIS_DBINDEX=0 # REDIS_PASSWORD= # REDIS_SOCKET= ################################################################################### # Upload File Config ################################################################################### UPLOAD_LOCATION=/opt/immich/upload ################################################################################### # JWT SECRET ################################################################################### JWT_SECRET=randomstringthatissolongandpowerfulthatnoonecanguess ################################################################################### # MAPBOX #################################################################################### # ENABLE_MAPBOX is either true of false -> if true, you have to provide MAPBOX_KEY ENABLE_MAPBOX=false MAPBOX_KEY= ################################################################################### # WEB - Required ################################################################################### # This is the URL of your vm/server where you host Immich, so that the web frontend # know where can it make the request to. # For example: If your server IP address is 10.1.11.50, the environment variable will # be VITE_SERVER_ENDPOINT=http://10.1.11.50:2283/api # !CAUTION! THERE IS NO FORWARD SLASH AT THE END VITE_SERVER_ENDPOINT=http://192.168.1.12:2283/api VITE_LOGIN_PAGE_MESSAGE= ``` </details> <details> <summary>immich-web logs</summary> ``` > web@0.0.1 build > svelte-kit build vite v2.9.8 building for production... transforming... ✓ 801 modules transformed. rendering chunks... .svelte-kit/output/client/_app/manifest.json 6.18 KiB .svelte-kit/output/client/_app/pages/__layout.svelte-eef758d9.js 20.99 KiB / gzip: 7.66 KiB .svelte-kit/output/client/_app/error.svelte-77365d18.js 1.56 KiB / gzip: 0.75 KiB .svelte-kit/output/client/_app/start-215867cf.js 24.75 KiB / gzip: 8.75 KiB .svelte-kit/output/client/_app/pages/admin/index.svelte-b1dd64f5.js 16.67 KiB / gzip: 5.88 KiB .svelte-kit/output/client/_app/pages/auth/change-password/index.svelte-b9ca3cf0.js 6.75 KiB / gzip: 2.87 KiB .svelte-kit/output/client/_app/pages/auth/login/index.svelte-e690dfcc.js 4.68 KiB / gzip: 2.06 KiB .svelte-kit/output/client/_app/pages/auth/register/index.svelte-7bfa795e.js 7.34 KiB / gzip: 2.86 KiB .svelte-kit/output/client/_app/pages/index.svelte-6ab063bc.js 2.30 KiB / gzip: 1.18 KiB .svelte-kit/output/client/_app/pages/photos/_assetId_.svelte-1c414347.js 0.28 KiB / gzip: 0.22 KiB .svelte-kit/output/client/_app/chunks/index-ef4af6b9.js 12.54 KiB / gzip: 5.21 KiB .svelte-kit/output/client/_app/chunks/index-5bce63e4.js 0.79 KiB / gzip: 0.49 KiB .svelte-kit/output/client/_app/chunks/singletons-d1fb5791.js 0.05 KiB / gzip: 0.07 KiB .svelte-kit/output/client/_app/chunks/preload-helper-e4860ae8.js 0.55 KiB / gzip: 0.39 KiB .svelte-kit/output/client/_app/chunks/index-671921bc.js 1.76 KiB / gzip: 0.66 KiB .svelte-kit/output/client/_app/chunks/api-09a5d632.js 40.01 KiB / gzip: 10.18 KiB .svelte-kit/output/client/_app/chunks/navigation-0e6511d1.js 0.17 KiB / gzip: 0.15 KiB .svelte-kit/output/client/_app/chunks/full-screen-modal-f787b1df.js 1.22 KiB / gzip: 0.75 KiB .svelte-kit/output/client/_app/chunks/stores-3c8b13ca.js 0.60 KiB / gzip: 0.32 KiB .svelte-kit/output/client/_app/chunks/click-outside-53cfcece.js 0.21 KiB / gzip: 0.16 KiB .svelte-kit/output/client/_app/chunks/auth-api-9c6b9414.js 0.43 KiB / gzip: 0.16 KiB .svelte-kit/output/client/_app/chunks/status-box-6772cf80.js 21.28 KiB / gzip: 7.35 KiB .svelte-kit/output/client/_app/assets/pages/photos/index.svelte-5f6f7bc6.css 0.21 KiB / gzip: 0.18 KiB .svelte-kit/output/client/_app/assets/pages/__layout.svelte-9e4ac4ac.css 17.84 KiB / gzip: 4.41 KiB .svelte-kit/output/client/_app/pages/photos/index.svelte-234b1729.js 128.66 KiB / gzip: 41.12 KiB .svelte-kit/output/client/_app/chunks/leaflet-src-3bf39228.js 142.61 KiB / gzip: 41.34 KiB .svelte-kit/output/client/_app/chunks/assets-f83676e2.js 217.73 KiB / gzip: 75.52 KiB vite v2.9.8 building SSR bundle for production... transforming... ✓ 94 modules transformed. rendering chunks... .svelte-kit/output/server/manifest.json 4.47 KiB .svelte-kit/output/server/index.js 75.63 KiB .svelte-kit/output/server/entries/endpoints/auth/logout.ts.js 0.20 KiB .svelte-kit/output/server/entries/endpoints/auth/change-password/index.ts.js 0.72 KiB .svelte-kit/output/server/entries/endpoints/auth/login/index.ts.js 1.40 KiB .svelte-kit/output/server/entries/endpoints/auth/register/index.ts.js 0.77 KiB .svelte-kit/output/server/entries/endpoints/admin/api/create-user.ts.js 0.76 KiB .svelte-kit/output/server/entries/pages/__layout.svelte.js 8.35 KiB .svelte-kit/output/server/entries/fallbacks/error.svelte.js 0.72 KiB .svelte-kit/output/server/entries/pages/admin/index.svelte.js 6.53 KiB .svelte-kit/output/server/entries/pages/auth/change-password/index.svelte.js 3.27 KiB .svelte-kit/output/server/entries/pages/auth/login/index.svelte.js 1.93 KiB .svelte-kit/output/server/entries/pages/auth/register/index.svelte.js 3.36 KiB .svelte-kit/output/server/entries/pages/index.svelte.js 1.57 KiB .svelte-kit/output/server/entries/pages/photos/_assetId_.svelte.js 0.42 KiB .svelte-kit/output/server/entries/pages/photos/index.svelte.js 11.02 KiB .svelte-kit/output/server/chunks/index-ab6b5b88.js 4.26 KiB .svelte-kit/output/server/chunks/api-b55d1334.js 63.01 KiB .svelte-kit/output/server/chunks/assets-381617f7.js 5.00 KiB .svelte-kit/output/server/chunks/stores-4ada7be4.js 0.92 KiB .svelte-kit/output/server/chunks/status-box-3a3fccf6.js 11.80 KiB .svelte-kit/output/server/chunks/hooks-fc354f95.js 1.31 KiB file:///usr/src/app/.svelte-kit/output/server/chunks/hooks-fc354f95.js:2 import { AxiosError } from "axios"; ^^^^^^^^^^ SyntaxError: Named export 'AxiosError' not found. The requested module 'axios' is a CommonJS module, which may not support all module.exports as named exports. CommonJS modules can always be imported via the default export, for example using: import pkg from 'axios'; const { AxiosError } = pkg; at ModuleJob._instantiate (node:internal/modules/esm/module_job:128:21) at async ModuleJob.run (node:internal/modules/esm/module_job:194:5) at async Promise.all (index 0) at async ESMLoader.import (node:internal/modules/esm/loader:385:24) at async Server.respond (file:///usr/src/app/.svelte-kit/output/server/index.js:2317:22) at async visit (file:///usr/src/app/node_modules/@sveltejs/kit/dist/chunks/index2.js:1085:20) ``` </details> Anything else I could provide to diagnose this? Probably just an oversight on my part but I cannot find what I did differently from before while not changing anything.... *stumped*.
Author
Owner

@alextran1502 commented on GitHub (Jul 13, 2022):

Please use the new docker-compose file in the repository, your content is out of date and will no longer work

@alextran1502 commented on GitHub (Jul 13, 2022): Please use the new docker-compose file in the repository, your content is out of date and will no longer work
Author
Owner

@Cantello commented on GitHub (Jul 13, 2022):

You were totally right, I just briefly checked the sample docker file for changes, apparently too brief... :-)

@Cantello commented on GitHub (Jul 13, 2022): You were totally right, I just briefly checked the sample docker file for changes, apparently too brief... :-)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#142