Could not load the Qt platform plugin "xcb" errore when building the snap

Hi, I’m trying to create a snap out of LRCGET. When snapcraft is on the buildind part, I get this error, specifically on the execution of npm run tauri build :

2025-01-18 10:56:59.596 :: 2025-01-18 10:56:58.552 :: qt.qpa.xcb: could not connect to display
2025-01-18 10:56:59.596 :: 2025-01-18 10:56:58.553 :: qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
2025-01-18 10:56:59.596 :: 2025-01-18 10:56:58.553 :: Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.

When I go into snapcraft --debug and do the commands manually, I get no error. So I guess that the build cannot be done headless. Is there a way to still make it work ? I looked into dekstop-launcher, as suggested here, but as I understand it, it works for the app section, not a part section. Here is my snapcraft.yaml :

name: lrcget # you probably want to 'snapcraft register <name>'
base: core24 
version: '0.1'
summary: Téléchargez les paroles de vos musiques préférées.
description: |
  Utilitaire pour télécharger en masse les paroles synchronisées LRC pour votre librairie de musiques hors-ligne.
  LRCGET scannera l'ensemble des fichiers d'un repértoire donné, trouvera vos musiques, et téléchargera les paroles sous la forme d'un fichier LRC ayant le même nom que celui du fichier musical et stocké au même endroit.
  LRCGET est le client officiel du service LRCLIB.
grade: devel # must be 'stable' to release into candidate/stable channels
confinement: devmode # use 'strict' once you have the right plugs and slots

parts:
  build:
    plugin: npm
    npm-include-node: true
    npm-node-version: 22.13.0
    source: .
    build-packages:
      - npm
      - cargo
      - rustc-1.80
      - pkg-config
      - libglib2.0-dev
      - libpango1.0-dev
      - libatk1.0-dev
      - libgdk-pixbuf-2.0-dev
      - libjavascriptcoregtk-4.1-dev
      - libsoup-3.0-dev
      - libgtk-3-dev
      - libwebkit2gtk-4.1-dev
      - libasound2-dev
      - librsvg2-dev
      - wget
      - sed
      - vite
    override-build: |
      npm install
      npm install -g @tauri-apps/cli
      npm audit fix
      npm run tauri build
  binary:
    after: [compilation]
    plugin: dump
    source: src-tauri/target/release/
    source-type: local
    organize: 
      LRCGET: bin/LRCGET

apps:
  lrcget:
    extensions: [gnome]
    command: desktop-launch bin/LRCGET
    plugs:
      - desktop
      - x11
      - wayland
      - opengl

Hope there’s a solution, thanks in advance !