Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🐞] Vite error @qwik-router-not-found-path when migrating to v2 #7131

Closed
steffanek opened this issue Dec 4, 2024 · 2 comments
Closed
Labels
STATUS-1: needs triage New issue which needs to be triaged TYPE: bug Something isn't working

Comments

@steffanek
Copy link

steffanek commented Dec 4, 2024

Which component is affected?

Qwik Runtime

Describe the bug

I've tried to migrate to v2 manually and I have a common qwik file to store qwik related function, components and types.
When importing for example Slot from this common file, I've noticed a vite error.
See the repro in src > routes > layout.tsx where I explicitly do: import { Slot } from '~/common/qwik';

Reproduction

https://stackblitz.com/edit/github-7ygh5v?file=src%2Froutes%2Findex.tsx,src%2Froutes%2Flayout.tsx,src%2Fcomponents%2Frouter-head%2Frouter-head.tsx,src%2Fcommon%2Fqwik.ts,src%2Fentry.ssr.tsx,src%2Fentry.preview.tsx,src%2Fentry.dev.tsx,tsconfig.json,vite.config.ts,src%2Froot.tsx

Steps to reproduce

No response

System Info

ystem:
    OS: macOS 14.3
    CPU: (8) arm64 Apple M3
    Memory: 1.55 GB / 24.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.2.0 - /opt/homebrew/bin/node
    npm: 10.7.0 - /opt/homebrew/bin/npm
    pnpm: 9.7.0 - /opt/homebrew/bin/pnpm
  Browsers:
    Safari: 17.3
  npmPackages:
    @builder.io/qwik: ^1.11.0 => 1.11.0
    @builder.io/qwik-city: ^1.11.0 => 1.11.0
    typescript: 5.6.3 => 5.6.3
    undici: ^6.21.0 => 6.21.0
    vite: 6.0.2 => 6.0.2

Additional Information

As discussed today @wmertens, my feeling was right about the common/qwik causing it.

@steffanek steffanek added STATUS-1: needs triage New issue which needs to be triaged TYPE: bug Something isn't working labels Dec 4, 2024
@wmertens
Copy link
Member

wmertens commented Dec 6, 2024

The reason the build failed was the re-exporting of the vite plugins in common/qwik.ts

Removing those as well as the node middleware makes the build work.

However, when re-exporting a xyz$ function, the corresponding xyzQrl function must also be exported. Furthermore, you can't re-export $, it's special and must be imported from the Qwik core library.

We recommend not re-exporting qwik functions.

@wmertens wmertens closed this as completed Dec 6, 2024
@gioboa
Copy link
Member

gioboa commented Dec 6, 2024

@steffanek We should document that, would you like to contribute with a docs PR?
I think the right place could be here in the build/v2/ branch. Thanks in advance 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
STATUS-1: needs triage New issue which needs to be triaged TYPE: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants