This is the configuration in webpack.config.js
output: {
filename: 'bundle.min.js',
sourceMapFilename: '[file].map',
path: path.resolve(__dirname , 'dist/assets'),
publicPath: '/assets/'
},
devServer: {
contentBase: './dist',
historyApiFallback: true,
publicPath: '/assets/',
port: 3000
}
This is how routing is done
const history = createBrowserHistory();
const Routes: any = () => (
<Router history={history}>
<Switch>
<Route exact path='/' component={Home} />
<Route exact path='/activate/:code' component={Home} />
<Route path='/items' component={Items} />
<Route component={NotFound} />
</Switch>
</Router>
);
When I try to enter the path: / activate /: code the browser gives the following error:
Refused to execute script from ' link ' because its MIME type ('text / html') is not executable, and strict MIME type checking is enabled.
So you can not find it and that's what the tree looks like in the Chrome tool:
Does anyone know how to solve this problem? I have tried many things and none has worked.
It is clear to me that something is wrongly configured in webpack, but what is it?
I appreciate the help you can give me.