-
Notifications
You must be signed in to change notification settings - Fork 448
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 path alias not working with sanity dev
#4489
Comments
Hi @surjithctly, I've recently been in the trenches on a similar task, assisting a client with migrating their existing Sanity project into an NX Monorepo. For the sake of clarity, let's say our application is in
To set up a path alias for
I hope this proves helpful 😀 |
@saiichihashimoto && @leonlafa at least let's use this vite plugin thingy to eliminate double administration... worked for me at least ¯\(ツ)/¯ but note, that this whole vite toy is not my game. |
I was able to get this to work for future reference.
|
Another workaround using nx:
|
Describe the bug
When using Path Alias in a Next.js project for
sanity.cli.ts
andsanity.config.ts
using@/
it throws the following error. While all other next.js files uses this method, it would be great if Sanity supports them as well.To Reproduce
Use import using Path alias configured in
tsconfig
such as@/
Expected behavior
The path should resolve as normally.
Screenshots
If applicable, add screenshots to help explain your problem.
Which versions of Sanity are you using?
What operating system are you using?
Mac / M1 / VSCode
Which versions of Node.js / npm are you running?
The text was updated successfully, but these errors were encountered: