Vue.js Nuxt运行时错误-拒绝执行脚本,因为其MIME类型(';text/html';)不可执行,并且启用了严格的MIME类型检查
我可以使用命令Vue.js Nuxt运行时错误-拒绝执行脚本,因为其MIME类型(';text/html';)不可执行,并且启用了严格的MIME类型检查,vue.js,webpack,nuxt.js,Vue.js,Webpack,Nuxt.js,我可以使用命令npm run dev 当我构建代码并在服务器中启动时,我得到一个错误-('text/html')对于.js文件是不可执行的 错误: Refused to execute script from 'https://app.mydomain.com/_nuxt/dist/3574538.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
npm run dev
当我构建代码并在服务器中启动时,我得到一个错误-('text/html')对于.js文件是不可执行的
错误:
Refused to execute script from 'https://app.mydomain.com/_nuxt/dist/3574538.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
这是我的numxt.config.js
代码,我在这里犯了什么错误
export default {
server: {
port: 8000 // default: 3000
},
target: 'server',
head: {
title: 'test Title',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
],
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }],
},
components: true,
buildModules: [
'@nuxtjs/tailwindcss',
'@nuxtjs/composition-api'
],
modules: [
'@nuxtjs/axios',
],
axios: {
// proxy: true
},
buildDir: '_nuxt',
build: {
publicPath: '_nuxt/dist/'
}
}