Replies: 18 comments 13 replies
-
any solution ? |
Beta Was this translation helpful? Give feedback.
-
No, I ended up deleting the folder then reinstalling Vite and gh- pages. I now have a 404 page instead.SaraSent from my iPhoneOn 22 Jul 2023, at 16:52, Ahmeduddin ***@***.***> wrote:
any solution ?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Have you tried setting your import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
base: "https://saram7619.github.io/deploying-vite-project-example/",
}); |
Beta Was this translation helpful? Give feedback.
-
Does anyone have a solution to this? I've had a problem with this on a few of my projects recently. TYIA |
Beta Was this translation helpful? Give feedback.
-
I had the same thing with a couple of projects a couple of months ago. I deleted my project after copying my code into my notes app, started a new project and the mime type error went away. I think the error appears because you have 2 HTML files with one in the root folder and one in dist folder, but I fixed the error months ago with stack overflow but I can’t remember how I did it. Sorry I couldn’t be more helpful. Don’t move your HTML files, you will create more errors and problems. |
Beta Was this translation helpful? Give feedback.
-
after doing all the above I manage to set my project up.
than I run : and than I was able to access the project via : |
Beta Was this translation helpful? Give feedback.
-
I had this problem, solved by following the static site publish here: https://vitejs.dev/guide/static-deploy.html#github-pages |
Beta Was this translation helpful? Give feedback.
-
I fixed the issue by adding import { defineConfig } from "vite";
import react from "@vitejs/plugin-react-swc";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
assetsInclude: ["**/*.JPG"],
base: "./",
}); |
Beta Was this translation helpful? Give feedback.
-
this is my repo https://github.com/MdNihal005/password-generator |
Beta Was this translation helpful? Give feedback.
-
What I do now is simply not run build. I let vercel hosting do it for me
through my git repo.
…On Thu, 8 Feb 2024, 03:59 MdNihal005, ***@***.***> wrote:
Loading module from “https://mdnihal005.github.io/assets/index-m_29T7Ax.js” was blocked because of a disallowed MIME type (“text/html”)
this is my repo https://github.com/MdNihal005/password-generator
and this is link https://mdnihal005.github.io/password-generator/
can someone help me with this
—
Reply to this email directly, view it on GitHub
<#13910 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A7NKW3FD4IKO3DATHLMZYDDYSREQLAVCNFSM6AAAAAA2RVYZG2VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DIMBTGAZTQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I set my base to |
Beta Was this translation helpful? Give feedback.
-
It is free to host. Domains etc cost money obviously
…On Sun, 11 Feb 2024, 11:24 MdNihal005, ***@***.***> wrote:
should add dist folder to my repo ?
—
Reply to this email directly, view it on GitHub
<#13910 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A7NKW3F2RL2K6BHIBDPWF7LYTCTARAVCNFSM6AAAAAA2RVYZG2VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DIMZSGI2TQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I don't. I literally just upload the project to GitHub through VS code,
then as I say, host through vercel. No building at all
…On Sun, 11 Feb 2024, 11:24 MdNihal005, ***@***.***> wrote:
should add dist folder to my repo ?
—
Reply to this email directly, view it on GitHub
<#13910 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A7NKW3F2RL2K6BHIBDPWF7LYTCTARAVCNFSM6AAAAAA2RVYZG2VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DIMZSGI2TQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Oh thank you! Netlify also works but I found vercel a little more reliable
and easy to use for domain transfer when I did move everything over to
vercel.
Also, if you've not seen it, if you're making a project in Next.js Vercel
do a nice package for contact forms with Resend, they're all made by the
same folks ofc. May be worth a look at
…On Sun, 11 Feb 2024, 11:53 MdNihal05, ***@***.***> wrote:
Thanks I will try vercel...
And nice portfolio
—
Reply to this email directly, view it on GitHub
<#13910 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A7NKW3HSMAJA7HR7YZZQO5DYTCWLHAVCNFSM6AAAAAA2RVYZG2VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DIMZSGM4TA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I have tried most of this solution but now i am getting. |
Beta Was this translation helpful? Give feedback.
-
I also faced this problem. in html file: link href or script src use '/file path'. if this works then reply me. |
Beta Was this translation helpful? Give feedback.
-
I encountered this error. |
Beta Was this translation helpful? Give feedback.
-
Hi to everyone, I could resolve the error of : Page blocked because of a disallowed MIME type (“text/html”) After running the npm run dev command we get the dist folder, inside this folder there are a folder assets and index.html file. link rel="stylesheet" crossorigin href="/assets/index.css" This path is not working, a dot is missing, it should be like this: <script type="module" crossorigin src="./assets/index.js"></script>link rel="stylesheet" crossorigin href="./assets/index.css" So by adding a dot to the path, the problem is resolved. The page is accessible with : github.io/RepoName/dist/index.html |
Beta Was this translation helpful? Give feedback.
-
I have been trying to fix this error
Loading module from “https://saram7619.github.io/assets/index-e92ae01e.js” was blocked because of a disallowed MIME type (“text/html”). deploying-vite-project-example.
When I click on view source to try and debug, I get this
What I have done
npm install create vite@latest
the folder is vite-demo - using react - typescript
cd vite-demo
npm install
npm run dev
I made a new github repository called deploying-vite-project-example
went through all the github steps
added th following to my vite config file
base: "/deploying-vite-project-example/",
added all files to my repository
took my dist files out of gitignore
npm run build
pushed to gh-pages.
all files are on my repository,
I click on the live website and I get a blank page.
My github repository is https://saram7619.github.io/deploying-vite-project-example/
How do I fix this issue.
Beta Was this translation helpful? Give feedback.
All reactions