Vue CLI 3: Sourcemaps cannot be parsed by Chrome devtools
Asked Answered
H

0

9

I built my simple site using Vue UI (the ones that comes with Vue-CLI 3), and it created sourcemaps in the /dist folder. I deploy these sourcemaps along with the production files. When I load up my site, Chrome indicates it cannot parse the sourcemaps in Devtools.

DevTools failed to parse SourceMap: https://www.thisisnotarealdomain.net/js/app.92ef018b.js.map

I have tried the following in vue.config.js:

module.exports = {
    css: {
        // modules: true,
        loaderOptions: {
            // pass options to sass-loader
            sass: {
                // @/ is an alias to src/
                // so this assumes you have a file named `src/scss/variables.scss`
                data: `@import "@/scss/_globals.scss";`
            }
        }
    },
    configureWebpack: {
        devtool: '#source-map'
    }
}

and

module.exports = {
    css: {
        // modules: true,
        loaderOptions: {
            // pass options to sass-loader
            sass: {
                // @/ is an alias to src/
                // so this assumes you have a file named `src/scss/variables.scss`
                data: `@import "@/scss/_globals.scss";`
            }
        }
    },
    configureWebpack: {
        devtool: '#cheap-eval-source-map'
    }
}

But Chrome still complains and I cannot see my original source.

I found some articles on the Internet regarding Webpack and Chrome interaction with sourcemaps, but I cannot tell if the problem has been resolved. Is there a problem with sourcemaps created by Vue UI?

Thanks.

Hydra answered 8/9, 2018 at 12:52 Comment(6)
Having the same issue. Did you ever solve this?Pah
No, it is still unresolved. I have tried to ask this on the Vue forums in the distant past but nobody answered.Hydra
why are you using hash in devtool prop value?Dotdotage
The hash values are values I found in other internet pages over 2 years ago when I was looking for a solution. Do you have a solution I should use?Hydra
Did you ever find a solution, also have the same issue?Yaroslavl
@keziakoko: I have not found a solution. I have tried asking in the Vue forums, but nobody answered either.Hydra

© 2022 - 2024 — McMap. All rights reserved.