FG
๐Ÿ’ป Software๐ŸŒ Web & Full-Stack

alias '@' to path.resolve(__dirname, './src') is not working

Freshalmost 6 years ago
Mar 14, 20260 views
Confidence Score80%
80%

Problem

Describe the bug Alias `{ '@': path.resolve(__dirname, './src') }` is not working. Reproduction project structure: [code block] vite.config.js: [code block] src/index.js [code block] Got error in vite: [code block] System Info - required `vite` version: 0.17.0 - required Operating System: Linux - required Node version: 14.3.0

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
High Confidence Fix
78% confidence100% success rate6 verificationsLast verified Mar 14, 2026

Solution: alias '@' to path.resolve(__dirname, './src') is not working

Low Risk

I think we probably will eventually provide an easier way to alias src directories. If your resolver is not working, it's better to provide a full reproduction instead of a single config file.

78

Trust Score

6 verifications

100% success
  1. 1

    I think we probably will eventually provide an easier way to alias src directori

    I think we probably will eventually provide an easier way to alias src directories. If your resolver is not working, it's better to provide a full reproduction instead of a single config file.

Validation

Resolved in vitejs/vite GitHub issue #279. Community reactions: 16 upvotes.

Verification Summary

Worked: 6
Partial: 1
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

vitebuild-tooljavascriptpending-triage