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

378
Views
Vue2 source maps referencing vue.runtime.esm.js file, not component file

Maybe I'm misinterpreting what source maps should do in a Vue app, but shouldn't I get the *.vue file line number where the error is occurring? I always get a refernce to a line number in a vue.runtime.esm.js file. It references the component, but the line number in the component file would be more helpful. Do I need to install additional source map modules?

My vue.config is below:

module.exports = {
  assetsDir: "",
  publicPath: "/",
  css: {
    sourceMap: true,
    loaderOptions: {
      sass: {
        sassOptions: {},
      },
    },
  },
  configureWebpack: (config) => {
    if (process.env.NODE_ENV === "development") {
      config.devtool = "eval-source-map";

      config.output.devtoolModuleFilenameTemplate = (info) =>
        info.resourcePath.match(/^\.\/\S*?\.vue$/)
          ? `webpack-generated:///${info.resourcePath}?${info.hash}`
          : `webpack-yourCode:///${info.resourcePath}`;

      config.output.devtoolFallbackModuleFilenameTemplate =
        "webpack:///[resource-path]?[hash]";
    }
  },
};

This also doesn't work:

  configureWebpack: (config) => {
    config.devtool = "source-map";
  },

enter image description here

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I had to use 'cheap-module-source-map' instead of 'eval-source-map'. In the end it would look like this:

  configureWebpack: (config) => {
    if (process.env.NODE_ENV === "development") {
      config.devtool = "cheap-module-source-map";

      [...]
    }
  },

about 4 years ago · Juan Pablo Isaza Report
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!