9

I have a problem developing a website. I am using chrome to debug javascript functions. On one of my pages I see the following:

screenshot of the problem

You can see that my own javascript file gets executed, search.js. There is a duplicate of this file, called VM1769. This file also executes the same code, so a search request is sent twice.

I searched around, and saw someone solve this problem by disabling cache (while DevTools is open), but this did not work for me. I tried another version of Chrome, the problem is still here.

Does anyone have a solution?

Seki
  • 10,763
  • 6
  • 47
  • 68
Inigo
  • 331
  • 3
  • 12

3 Answers3

3

I got the same issue and found out that i really included the same JavaScript-File twice. So its not logical for me that Chrome shows the second execution as a VM-Script but it ended to do that when i deleted the duplicate include.

terraloader
  • 191
  • 1
  • 10
0

Hi I was getting this also and this was causing to have two duplicated chooses in my autocomplete text input. What I did was just to create a global flag to know whether the script file was already executed or not. I know this is not the solution but I just wanted to share this here since blocking the execution of the VM file has fixed my problem but I need to know yet how definitely to resolve this.

enter image description here

Oswaldo Zapata
  • 637
  • 8
  • 9
0

I was experiencing this issue.

For me it was caused by webpack injecting a second instance of my javascript files for debugging.

Removing the last line (mode: "development") eradicated the duplicate script.

const webpack = require('webpack');

module.exports = {
    entry: {
        a: [./scripts/xxx.ts"],
        b: ["./scripts/yyy.ts"],
        c: ["././scripts/zzz.ts"]
    },
    output: {
        // runtime asset location
        path: __dirname + "/dist/js/bundles",
        filename: '[name].js',
        library: "$",
        libraryTarget: "umd"
    },
    plugins: [
        new webpack.CleanPlugin(),
    ],
    module: {
        rules: [
            { test: /\.ts$/, use: 'ts-loader', exclude: /node_modules/ },
        ],
    },
    resolve: {
        extensions: ['.ts'],
    },
    mode: "development"
};
lazarus
  • 362
  • 2
  • 9