Replies: 22 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'm using aws s3 static websites and I can't figure this out, i've tried the ./ and the / nothing is working |
Beta Was this translation helpful? Give feedback.
-
Hi,
I try to see your code, which repository is it ?
Could you share the code and the build code.
Thank you
…On Saturday, December 28th, 2024 at 10:27 AM, Jeremy Conterio ***@***.***> wrote:
i'm using aws s3 static websites and I can't figure this out, i've tried the ./ and the / nothing is working
—
Reply to this email directly, [view it on GitHub](#13910 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/BFEHHX7NAZYWTIFMHSMSXGL2HZVJTAVCNFSM6AAAAAA2RVYZG2VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCNRYGM3DQOA).
You are receiving this because you commented.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Really, you should not be configuring the base url in your vite config directly, because then it makes your repository non-portable. e.g. if someone forks it, or you rename it, it will break. Instead, it's very easy to just pass the base url to Vite programmatically, e.g.: name: Deploy Vite build to Pages
on:
# Runs on pushes targeting the default branch
push:
branches:
- master
# Allow running workflow manually from the Actions tab
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 21
cache: npm
- name: Install dependencies
run: npm ci
# This enables Pages and gives us the base path we need for the Vite build
- name: Setup Pages
id: pages
uses: actions/configure-pages@v4
# See: https://vite.dev/guide/build.html#public-base-path
- name: Build with Vite
run: npm run build -- --base "${{ steps.pages.outputs.base_path }}"
- name: Upload production build
uses: actions/upload-pages-artifact@v3
with:
path: ./dist
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4 You can see this working live in this repo: forresthopkinsa/LineGame.js |
Beta Was this translation helpful? Give feedback.
-
Clear cache resolve the issue look at #17738 |
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