404 after configuring alias
See original GitHub issueDescribe the bug
Reproduction
System Info
Output of npx envinfo --system --npmPackages vite,@vitejs/plugin-vue --binaries --browsers
:
npmPackages:
@vitejs/plugin-vue: ^1.2.1 => 1.2.1
@vue/compiler-sfc: ^3.0.5 => 3.0.11
typescript: ^4.1.3 => 4.2.4
vite: ^2.1.5 => 2.2.1
vite-plugin-rewrite-all: ^0.1.2 => 0.1.2
vue: ^3.0.5 => 3.0.11
vue-router: ^4.0.6 => 4.0.6
vue-tsc: ^0.0.24 => 0.0.24
Used package manager: npm
cofig.js
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import {resolve} from 'path'
import pluginRewriteAll from 'vite-plugin-rewrite-all';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue(),],
// resolve: {
// alias: {
// '/lib/': resolve(__dirname,'lib'),
// '/module/': resolve(__dirname,'scr/module'),
// }
// },
assetsInclude:resolve(__dirname,'lib')
})
Logs
vite:spa-fallback Not rewriting GET /libtiles/16/12320/2565.png because the path includes a dot (.) character. +17ms
vite:time 5ms /index.html +19ms
vite:spa-fallback Not rewriting GET /libtiles/16/12320/2567.png because the path includes a dot (.) character. +11ms
vite:time 3ms /index.html +10ms
vite:spa-fallback Not rewriting GET /libtiles/16/12322/2566.png because the path includes a dot (.) character. +5ms
vite:time 2ms /index.html +4ms
vite:spa-fallback Not rewriting GET /libtiles/16/12319/2565.png because the path includes a dot (.) character. +4ms
remove alias config
vite:time 3ms /lib/tiles/16/12326/2565.png +1ms
vite:time 2ms /lib/tiles/16/12323/2569.png +872ms
vite:time 1ms /lib/tiles/16/12322/2569.png +0ms
vite:time 2ms /lib/tiles/16/12324/2569.png +3ms
vite:time 2ms /lib/tiles/16/12321/2569.png +1ms
vite:time 3ms /lib/tiles/16/12325/2569.png +7ms
vite:time 3ms /lib/tiles/16/12320/2569.png +1ms
vite:time 3ms /lib/tiles/16/12326/2569.png +0ms
vite:time 1ms /lib/tiles/16/12319/2569.png +69ms
Before submitting the issue, please make sure you do the following
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isnβt already an issue that reports the same bug to avoid creating a duplicate.
- Provide a description in this issue that describes the bug.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if itβs a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/vue-next instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
βhttp://localhost:3000/lib/tiles/16/12320/2566.pngβ 404
Document tree structure
.
βββ README.md
βββ index.html
βββ lib
βΒ Β βββ AreaRestriction_min.js
βΒ Β βββ CurveLine.min.js
βΒ Β βββ images
βΒ Β βΒ Β βββ .....
βΒ Β βββ js解ι.txt
βΒ Β βββ map3.0.js
βΒ Β βββ map3.0_init.js
βΒ Β βββ modules
βΒ Β βΒ Β βββ vmlcontext_41oars.js
βΒ Β βΒ Β βββ ε
¨ι¨ζ¨‘ε.txt
βΒ Β βββ tiles
βΒ Β βββ 14
βΒ Β βββ 3078
βΒ Β βΒ Β βββ 640.png
βΒ Β βΒ Β βββ 641.png
βΒ Β βΒ Β βββ 642.png
βΒ Β βΒ Β βββ 643.png
βΒ Β βΒ Β βββ 644.png
βΒ Β βββ 3079
βΒ Β βΒ Β βββ 640.png
βΒ Β βΒ Β βββ 641.png
βΒ Β βΒ Β βββ 642.png
βΒ Β βΒ Β βββ 643.png
βΒ Β βΒ Β βββ 644.png
βΒ Β βββ 3080
βΒ Β βΒ Β βββ 642.png
βΒ Β βΒ Β βββ 643.png
βΒ Β βΒ Β βββ 644.png
βΒ Β βββ 3081
βΒ Β βΒ Β βββ 640.png
βΒ Β βΒ Β βββ 641.png
βΒ Β βΒ Β βββ 642.png
βΒ Β βΒ Β βββ 644.png
βΒ Β βββ 3082
βΒ Β βΒ Β βββ 640.png
βΒ Β βΒ Β βββ 641.png
βΒ Β βΒ Β βββ 642.png
βΒ Β βΒ Β βββ 643.png
βΒ Β βΒ Β βββ 644.png
βΒ Β βββ 3083
βΒ Β βββ 640.png
βΒ Β βββ 641.png
βΒ Β βββ 642.png
βΒ Β βββ 644.png
βββ node_modules
β βββ.....
βββ package-lock.json
βββ package.json
βββ public
βΒ Β βββ favicon.ico
βββ src
βΒ Β βββ App.vue
βΒ Β βββ assets
βΒ Β βΒ Β βββ logo.png
βΒ Β βββ components
βΒ Β βΒ Β βββ HelloWorld.vue
βΒ Β βββ index.css
βΒ Β βββ main.js
βΒ Β βββ main.js.map
βΒ Β βββ main.ts
βΒ Β βββ module
βΒ Β βΒ Β βββ ComplexCustomOverlay.js
βΒ Β βΒ Β βββ ComplexCustomOverlay.js.map
βΒ Β βΒ Β βββ ComplexCustomOverlay.ts
βΒ Β βββ router
βΒ Β βΒ Β βββ index.js
βΒ Β βΒ Β βββ index.js.map
βΒ Β βΒ Β βββ index.ts
βΒ Β βββ shims-vue.d.ts
βββ tsconfig.json
βββ vite.config.ts
709 directories, 21053 files
Issue Analytics
- State:
- Created 2 years ago
- Comments:15 (5 by maintainers)
Top Results From Across the Web
Directory Alias in OHS Failing with 404 Error
Symptoms. On : 12.2.1.1.0 version, OHS Module When attempting to access a URI containing an alias defined in httpd.conf results in HTTP 404...
Read more >SOLVED: Pathauto Alias always goes to 404 - Drupal
F.e. I have /node/1 and manually set /about alias. After change node, this is happening, /node/1 redirect to /about, but /about returns 404...
Read more >Alias inside VirtualHost is not working and gives 404 error
I have a server which maintains multiple domains using VirtualHost and I'm trying to setup GitWeb according toΒ ...
Read more >404 Error for Permalinks with Apache Alias and Wordpress
When you use Alias /blog then accessing WP posts using permalink example.com/blog/sample-post/ will be redirected to example.com by Apache soΒ ...
Read more >Cannot seem to get domain alias to work--i'm getting 404 errors
I am using openlitespeed as part of the new package at digital ocean. I have setup several wordpress domains successfully and have them...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The issue is that v1 never got to a stable release and most users of Vite havenβt used that v1. By giving this a higher position you are lowering other topics that may help more people. We could add a note maybe at the getting started guide, but I donβt know if that would help. I think the best is to use the search functionality in the docs that would have guided you to the migration guide if you searched for βaliasβ
The command should be
npm init @vitejs/app