What is the reason for self-generated code in the editor?

This code automatically appears in the first line of the code editor, I haven’t found any other people experiencing this problem on the internet. Does anyone know the problem? It also generates an error in the console.

const { log } = require("winjs")

What code editor? Are you using some kind of auto-import extension?

I can use Visual Studio Code and ı don’t use.

The only time I’ve seen something like that is if someone has auto imports on.

Is this happening on an empty file or after you type something into the file. Perhaps dod. you type something like “log”?

Sorry, I don’t know how to help you without more information. Maybe someone else can.

I am using Materialize.css and I am creating an api application, but there is very little code in it.

You didn’t really answer my questions.

  1. Is this happening on an empty file or after you type something into the file.
  2. If it is after typing something into the file, what did you type?

It turns out when I write any javascript code, it doesn’t matter what I write

How are you creating the file?

By pressing the file creation button in VSCode

So you go file > new, it opens a buffer, but that buffer has no file type, it’s not a file at that point. You need to either specify what file type it is at the bottom right, or save it as a JavaScript file. Or if you add the file using the little + in the files view on the left, you need to type in like “myfile.js”. At what point does that line appear

The file that this code came up with says that there is a javascript file, but if I create a new one it says “Plain Text”

Right, so does it appear in the plain text file. Then if not, if you change the file type to JavaScript, does it appear then. If not, does it appear when you start typing? Or if you save the file? And by “file creation button” do you mean this button: