Qmllint doesn't find qml type declarations

Hey,

When running qmllint in a shell with kdePackages.qtdeclarative results in the following error:

Error
╰─>$ qmllint src/shell.qml
Warning: src/shell.qml: Warnings occurred while importing base modules: [import]
---
Warning: Failed to find the following builtins: builtins.qmltypes, jsroot.qmltypes (so will use qrc). Import paths used:
	/home/ny/.config/quickshell
	/nix/store/62rz6d59b1pi3pwx9yxc8q3aak2xlmz3-qtbase-6.7.2/lib/qt-6/qml [import]
---

Warning: src/shell.qml:1:1: Warnings occurred while importing module "Quickshell": [import]
import Quickshell
^^^^^^
---
Warning: Failed to import Quickshell. Are your import paths set up properly? [import]
---

Warning: src/shell.qml:5:1: Scope was not found. Did you add all import paths? [import]

^^^^^
Warning: src/shell.qml:4:1: ShellRoot was not found. Did you add all import paths? [import]
ShellRoot {
^^^^^^^^^
Warning: src/shell.qml:5:5: Cannot assign to non-existent default property [missing-property]
    Bar {}
    ^^^

Which checks out, because /nix/store/62rz6d59b1pi3pwx9yxc8q3aak2xlmz3-qtbase-6.7.2/lib/qt-6/qml does in fact not exist:

eza
╰─>$ eza -la /nix/store/62rz6d59b1pi3pwx9yxc8q3aak2xlmz3-qtbase-6.7.2/lib/qt-6/
dr-xr-xr-x - root  1 Jan  1970 plugins

Now when I provide the paths manually everything works normally:

Succesfull Linting
┬─[ny@marr:~/.c/quickshell]─[19:09:19]─[G:main=]─[nix-shell]
╰─>$ qmllint src/shell.qml -I /nix/store/1bwc1r6y30c7s32vi4dh9c3jwwlwmcjh-qtdeclarative-6.7.2/lib/qt-6/qml/ -I /nix/store/drqfbjn8cz93b0mvadld05dgiiwywban-quickshell-0.1.0/lib/qt-6/qml/
┬─[ny@marr:~/.c/quickshell]─[19:09:19]─[G:main=]─[nix-shell]

Same goes as well for qmlls, probably because it is using qmllint behind the scenes. Is this a known issue and is there a known solution ?

Thank you

1 Like

Sounds like a wrapping issue with the qmllint binary, maybe report that on the github repo itself:

1 Like

alright, thank you, open an issue here: