-
Notifications
You must be signed in to change notification settings - Fork 770
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Server is not a constructor V.1.41 #56
Comments
Did you run |
Yes, I still get the error. |
index.mjs
|
If your using the latest version which includes the latest bare version server was deprecated and replaced with createBareServer |
I think it is a newer version
|
btw this is a very old fork, probably even before v1.41, but maybe v.1.41 |
ok so since ur using a newer version of Bare, the "server" function has been deprecated in place for { createBareServer } so in your backend just change the line: |
I changed the code to this:
and nothing is happening, the ouput console is empty. |
Ok that means it should be working cus that code doesn’t have a console.log that states the server is ready so try visiting http://localhost:6969 and seeing if it worked |
nevermind, i get this error
|
on this line
|
Sorry I forgot to respond but the ,'' I dont think works. So I would suggest changing it to: |
import { createBareServer } from 'bare-server-node'; const bare = createBareServer('/bare/'); const server = http.createServer(); server.on('request', (request, response) => { server.on('upgrade', (req, socket, head) => { server.listen(process.env.PORT || 6969); file:///home/runner/teemingarcticports/index.mjs:12 TypeError: bare.route_request is not a function Node.js v18.12.1 |
Alright since that isn’t working just copy and paste the new backend code instead of the really old one which can be found: https://github.com/TerbiumOS/webOS/blob/main/index.js |
/home/runner/teemingarcticports/index.js:1 SyntaxError: Cannot use import statement outside a module new code |
Copy package.json too |
I'm sorry, I was locked out of my github acc for a while, can we meet on discord or something and debug it? It works but I get this error Error: ENOENT: no such file or directory, stat '/home/runner/teemingarcticports/static/sw/hvtrs8/-ymuvu`e,cmm' |
I saw someone had an error and it was with service workers, but I want to be able to customize my apps not just have the defaults, if it is possible to change it and bypass repls blocking, I will try to use the newest version. |
Yeah sure |
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);
The text was updated successfully, but these errors were encountered: