-1
I have a route that has the bar character "/"
in the middle, as shown below:
<Route path="/answers/:question_id" component={QuestionAnswers} />
The link works normal.
<Link to={`/questions/${question.id}`}>Answer</Link>
However, when I change the component or refresh the page gives the following error:
error: The "http://localhost:4000/questions/Bundle.js" feature was blocked due to MIME type ("text/html") not matching (X-Content-Type-Options: nosniff).
How do I make for the js
of the application always stay in /bundle.js
instead of questions/bundle.js
?
Man index.html
:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="theme-color" content="E0E0E0"/>
<title>QAR</title>
<link href="https://fonts.googleapis.com/css2?
family=Roboto:wght@100;400;700&display=swap" rel="stylesheet">
</head>
<body>
<div id="app"></div>
</body>
</html>
index.tsx
of the application:
import React from 'react'
import { render } from 'react-dom'
import App from './App'
render(<App />, document.getElementById('app'))
Show your
index.html
, probably the problem is there– Costamilam
Show your
index.html
compiled, run the build command and grab from the folder where it is created– Costamilam
There’s no way to answer! It’s a local mistake, it’s not supposed to happen this way.
– novic