Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/webpack/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vue.js Nuxt运行时错误-拒绝执行脚本,因为其MIME类型(';text/html';)不可执行,并且启用了严格的MIME类型检查_Vue.js_Webpack_Nuxt.js - Fatal编程技术网

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/'
  }
}