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

162
Views
Failed to resolve module specifier "net"

I am running express app.

I have a connect.js file I have a class in which I have some functions running some tcp/ip socket code.

And from html file, I am calling the connect.js file.

This connect.js file imports 'net' module.

Running index.js has no issues but the browser the browser throws

I get an error in the browser.

Failed to resolve module specifier "net". Relative references must start with either "/", "./", or "../". 

below are the snippets from my code.

/connect.js

import net from 'net'

class Connect{

    constructor(Ip, Port) {

        this.Host = Ip;
        this.Port = Port;
    }

index.js

app.get('/', function(req, res){
  res.render('main.html');

main.html

<head>
<title>Login</title>
<script type = "module" src= '../labconnect.js'></script>
</head>
about 4 years ago · Juan Pablo Isaza
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!