-
-
Notifications
You must be signed in to change notification settings - Fork 125
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
tsconfig paths can't be loaded #744
Comments
Does this example help? |
Hi ! the example works but uses the low level API with defineEntries (I don't see any docs, the API is a bit cryptic) as soon as using the pages directory with the minimal steps above. it does fail |
Hmm, it looks like more complicated than I thought.
Well, it's not for everybody, but I would like to learn how it feels cryptic... The docs are https://github.com/dai-shi/waku/blob/main/docs/minimal-api.mdx, but it's also "minimal". I agree it's not super developer friendly, because it's not. |
Hi, I have the same issue, and solve it by changing vite.config.ts, not use // import tsconfigPaths from 'vite-tsconfig-paths';
import { fileURLToPath } from 'node:url';
/** @type {import('vite').UserConfig} */
export default {
// plugins: [
// tsconfigPaths(),
// ],
resolve: {
alias: {
"@": fileURLToPath(new URL('./src', import.meta.url))
}
}
}; |
@jackeydou Thanks for investigating. @himself65 Does that sound reasonable? |
I am not very familiar with vite and its ecosystem, otherwise I could help with further debugging. |
I will check this today |
I can reproduce this
|
I'm guessing we didn't load vite config correctly somewhere |
I feel it's related to aleclarson/vite-tsconfig-paths#135 |
it's their bug, remove @dai-shi could close this issue Realted Code: https://github.com/aleclarson/vite-tsconfig-paths/blob/5c9477078d3a913ade563b168ff4a9ccace187a2/src/index.ts#L228 |
I think the real reason is inside |
So, is it a bug on our end? |
Kind of? Because I don't think |
giving some more context: In normal vite playground, for this line of code, id will be |
I just created a fresh waku template Can anyone verify that? |
When trying to import a client component using typescript path alias, I get the following error on screen
The main page displays for a second then fails with the error above.
The console has this error:
pnpm build gives:
Reproduction
I repro-ed with the following steps
pnpm create waku@latest
Change
to
Things I tried:
resolve.alias
directly. fails as soon as I import a client componentrepro repo: https://github.com/tclain-pillar/repro-waku-ts-paths
The text was updated successfully, but these errors were encountered: