Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

280
Views
Vue 3 : webpack scriptType options issues

I'm using Vue3 to build an offline application.

"To be clear the application planed to be open through an url like file://"

However since Vue3 introduced the modern version i'm getting CORS issues... It's mostly due to the fact that the property type="module" as been added to each script tags.

example:

<script defer="defer" type="module" src="js/app.b9b6cfbc.js"></script>

Error:

Access to script at 'file:///Users/[...]/project/js/app.dc625bea.js' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, https, ipns, chrome-untrusted, ipfs, data, chrome, chrome-extension.

Then when i remove the attribute "type" it works....

So I have been researching on how to remove that tag while webpack is compiling the app, I have been updating the output.scriptType options, however it sounds like the options is not been used... I'm still getting the same result

My vue.config.js:

const path = require('path')
module.exports = {
  publicPath: '.',
  outputDir: path.resolve(__dirname, './dist'),
  transpileDependencies: [
    'vue-echarts',
    'resize-detector'
  ],
  configureWebpack: {
    target: ['web', 'es5'],
    optimization: {
      splitChunks: false
    },
    output: {
      scriptType: 'text/javascript'
    }
  },
  devServer: {
    port: 3000
  }
}

Is it a webpack or vue3 issues?

about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!