Unable to import JavaScript module due to net::ERR_ABORTED 404 (Not Found) – How to fix?

I’ve searched this error on different platform and tried the answers but none worked here is my code

javascript:

import { Octokit } from "./octokit.js";
const TOKEN = "mytoken";
const octokit = new Octokit({
    auth: TOKEN
});

html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>gitmail</title>
</head>
<body>
    
</body>
<script type='module' src="test.js" ></script>
</html>

I tried with and without “.js” . tried with “../” and “./” I even wrote the full path to the module but that didn’t help as well.

I am using VS code as editor and the live server. Not only this module but other modules do not work as well