Skip to content

🐛 qwik with routesDir: "" will walk upwards infinitely #1632

@intellix

Description

@intellix

Prerequisites

Reproduction url

https://github.com/intellix/knip-qwik-empty-routes-issue

Reproduction access

  • I've made sure the reproduction is publicly accessible

Description of the issue

Since 5.86.0 (qwik plugin was introduced)

Was getting this locally and created a repro. We had a lot of libs with this, to get qwikCity working even though they didn't declare routes:

export default defineConfig({
  plugins: [qwikVite(), qwikCity({ routesDir: '' })],
});

When you run knip you get an error like this on macOS (and a different directory in linux during CI/CD obviously):

> knip

Analyzing workspace (libs/my-qwik-lib)…
node:internal/modules/run_main:107
    triggerUncaughtException(
    ^

[Error: EPERM: operation not permitted, scandir '/Library/Bluetooth'] {
  errno: -1,
  code: 'EPERM',
  syscall: 'scandir',
  path: '/Library/Bluetooth'
}

Node.js v24.11.1

Not sure if it's a general thing with the qwik plugin or knip in general, but it had me bamboozled for hours wondering what it meant.

Workaround

Change vite.config to this:

export default defineConfig({
  plugins: [qwikVite(), qwikCity({ routesDir: '.' })], // Add a dot for the routesDir
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions