TerbiumOS / webOS

TerbiumOS web is a web os packed with features, with new updates every so often
Apache License 2.0
132 stars 696 forks source link

Server isnt a constructor (v1.41) #42

Closed TheSman122333 closed 8 months ago

TheSman122333 commented 10 months ago

const bare = new Server('/bare/', ''); ^

TypeError: Server is not a constructor at file:///home/runner/TeemingArcticPorts/index.mjs:6:15 at ModuleJob.run (node:internal/modules/esm/module_job:193:25) at async Promise.all (index 0) at async ESMLoader.import (node:internal/modules/esm/loader:530:24) at async importModuleDynamicallyWrapper (node:internal/vm/module:438:15)

OS version 1.41 I think, I made a fork of terbium a looong time ago, and I recovered it. Using Opera GX/Chrome

The issue is that there is no output in the repls saying that server isnt a constructor, but in 1.41, and 1.42 it uses the code that gives the error

this code: import Server from 'bare-server-node'; import http from 'http'; import nodeStatic from 'node-static';

const bare = new Server('/bare/', ''); const serve = new nodeStatic.Server('static/');

const server = http.createServer();

server.on('request', (request, response) => { if (bare.route_request(request, response)) return true; serve.serve(request, response); });

server.on('upgrade', (req, socket, head) => { if(bare.route_upgrade(req, socket, head))return; socket.end(); });

server.listen(process.env.PORT || 6969);

Notplayingallday383 commented 9 months ago

Did you run npm i?

Notplayingallday383 commented 8 months ago

Did you run it?

TheSman122333 commented 5 months ago

So sorry, I do not know what happened, but it worked for a while, and then again its back to not working.

TheSman122333 commented 5 months ago

I am also using bare server latest (2.01)