tinacms / tinacms

A fully open-source headless CMS that supports Markdown and Visual Editing
https://tina.io
Apache License 2.0
11.19k stars 564 forks source link

🐛Vite - Internal server error: Failed to resolve import #4488

Open amankumarrr opened 1 month ago

amankumarrr commented 1 month ago

Describe the issue that you're seeing. Any Loom videos or screenshots usually help a lot!

I'm attempting to use aliases for imports, but I'm encountering an issue where Vite is unable to resolve the paths when generating config.prebuild.jsx.

Reproduction

https://github.com/amankumarrr/tina-module-alias-issue

Steps to reproduce

From Reproduction URL

Steps to Reproduce from a new Starter repo

System Info

Windows 11
Browser
- Chrome 
- Edge

Screenshot: image

Figure: Error getting while importing templates using alias

Validations

AntonWeigel commented 3 weeks ago

I am experiencing the same issue with my code. I use a path alias in my tsconfig.json that isn't recognized by Vite:

    "paths": {
      "@/*": ["./*"]
    }