最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - No loader is configured for ".html" files: index.html Vitejs - Stack Overflow

programmeradmin2浏览0评论

Greetings I have problem. I am using Visual studio 2022 and created two projects there for one solution. One for back-end (ASP.NET) and the second one for fron-end (vuejs and vite). So here starts the problem. I used npm create vue@3 mand to create vue project. And its launched fine , but when I did same thing in folder of front-end in my sln project vite throws error what it can not find index.html file

Error:   Failed to scan for dependencies from entries:
  D:/Projects/C#/DAINIS/vueapp/index.html

  X [ERROR] No loader is configured for ".html" files: index.html

    <stdin>:1:7:
      1 │ import "D:/Projects/C#/DAINIS/vueapp/index.html"
        ╵        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


    at failureErrorWithLog (D:\Projects\C#\DAINIS\vueapp\node_modules\esbuild\lib\main.js:1638:15)
    at D:\Projects\C#\DAINIS\vueapp\node_modules\esbuild\lib\main.js:1050:25
    at runOnEndCallbacks (D:\Projects\C#\DAINIS\vueapp\node_modules\esbuild\lib\main.js:1473:45)
    at buildResponseToResult (D:\Projects\C#\DAINIS\vueapp\node_modules\esbuild\lib\main.js:1048:7)
    at D:\Projects\C#\DAINIS\vueapp\node_modules\esbuild\lib\main.js:1060:9
    at new Promise (<anonymous>)
    at requestCallbacks.on-end (D:\Projects\C#\DAINIS\vueapp\node_modules\esbuild\lib\main.js:1059:54)
    at handleRequest (D:\Projects\C#\DAINIS\vueapp\node_modules\esbuild\lib\main.js:725:19)
    at handleIningPacket (D:\Projects\C#\DAINIS\vueapp\node_modules\esbuild\lib\main.js:747:7)
    at Socket.readFromStdout (D:\Projects\C#\DAINIS\vueapp\node_modules\esbuild\lib\main.js:675:7)

Just in case I did not changed project it is as is.
Project structure
Error dump example

I tried solutions found here and here in stack overflow but still no luck

Greetings I have problem. I am using Visual studio 2022 and created two projects there for one solution. One for back-end (ASP.NET) and the second one for fron-end (vuejs and vite). So here starts the problem. I used npm create vue@3 mand to create vue project. And its launched fine , but when I did same thing in folder of front-end in my sln project vite throws error what it can not find index.html file

Error:   Failed to scan for dependencies from entries:
  D:/Projects/C#/DAINIS/vueapp/index.html

  X [ERROR] No loader is configured for ".html" files: index.html

    <stdin>:1:7:
      1 │ import "D:/Projects/C#/DAINIS/vueapp/index.html"
        ╵        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


    at failureErrorWithLog (D:\Projects\C#\DAINIS\vueapp\node_modules\esbuild\lib\main.js:1638:15)
    at D:\Projects\C#\DAINIS\vueapp\node_modules\esbuild\lib\main.js:1050:25
    at runOnEndCallbacks (D:\Projects\C#\DAINIS\vueapp\node_modules\esbuild\lib\main.js:1473:45)
    at buildResponseToResult (D:\Projects\C#\DAINIS\vueapp\node_modules\esbuild\lib\main.js:1048:7)
    at D:\Projects\C#\DAINIS\vueapp\node_modules\esbuild\lib\main.js:1060:9
    at new Promise (<anonymous>)
    at requestCallbacks.on-end (D:\Projects\C#\DAINIS\vueapp\node_modules\esbuild\lib\main.js:1059:54)
    at handleRequest (D:\Projects\C#\DAINIS\vueapp\node_modules\esbuild\lib\main.js:725:19)
    at handleIningPacket (D:\Projects\C#\DAINIS\vueapp\node_modules\esbuild\lib\main.js:747:7)
    at Socket.readFromStdout (D:\Projects\C#\DAINIS\vueapp\node_modules\esbuild\lib\main.js:675:7)

Just in case I did not changed project it is as is.
Project structure
Error dump example

I tried solutions found here and here in stack overflow but still no luck

Share Improve this question asked Jun 1, 2023 at 17:38 InexInex 6121 gold badge6 silver badges13 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 7

The issue is the # symbol in your file path

D:/Projects/C#/DAINIS/vueapp/

I don't know the technical reason why this causes it to fail, but if you remove it, the project should run.

发布评论

评论列表(0)

  1. 暂无评论