Skip to content
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

Ubiq Node server not starting #47

Closed
TheBv opened this issue Jan 25, 2024 · 6 comments
Closed

Ubiq Node server not starting #47

TheBv opened this issue Jan 25, 2024 · 6 comments

Comments

@TheBv
Copy link
Contributor

TheBv commented Jan 25, 2024

Simply put running npm i followed by npm run start won't actually start the server.
Instead I get the following error:

H:\Repos\Uni\ubiq-dev\Node\node_modules\ts-node\dist-raw\node-internal-modules-esm-get_format.js:93
        throw new ERR_UNKNOWN_FILE_EXTENSION(ext, fileURLToPath(url));
              ^
CustomError: ERR_UNKNOWN_FILE_EXTENSION .ts H:\Repos\Uni\ubiq-dev\Node\node_modules\ubiq\index.ts

Hint:
ts-node is configured to ignore this file.
If you want ts-node to handle this file, consider enabling the "skipIgnore" option or adjusting your "ignore" patterns.

Main issue being that we are installing the submodules as dependencies but these are never transpiled to javascript.
So we'd need to tell ts-node that it's allowed to also transpile typescript files by adding the skipIgnore flag.
E.g ts-node-esm --skipIgnore app.ts

I'm not fully convinced that that's the best solution especially since this also requires us to add to @types dependencies since they are required by the ubiq-module.

Maybe I'm missing something though.
Otherwise I'd suggest that it might be a good idea to add a build step to the project that builds the various modules.

@sebjf
Copy link
Member

sebjf commented Jan 25, 2024

Hi @TheBv,

Could you say more about the environment you are running in/what the setup is?

If inside a new folder, I do a git clone and start the server, like so, it works OK:

$ git clone git@github.com:UCL-VR/ubiq.git .
$ cd Node/
$ npm i
$ npm start

Main issue being that we are installing the submodules as dependencies but these are never transpiled to javascript.

Do you mean to say that for your particular project you are including the ubiq server components as submodules in your project? And when transpiling your project it fails to transpile those?

Otherwise I'd suggest that it might be a good idea to add a build step to the project that builds the various modules.

This is a good suggestion for those that might want to transpile rather than use a loader. I will see if I can add a command to the package which demonstrates this.

@sebjf sebjf self-assigned this Jan 25, 2024
@TheBv
Copy link
Contributor Author

TheBv commented Jan 25, 2024

Could you say more about the environment you are running in/what the setup is?

Good point.
I've just tried this with node version 18 and it works fine.
I was using 19 before so I assume this might be an issue with versions >=19

Sorry for not considering that earlier ^^"

I think the easiest fix would probably to add an "engines" entry to the package.json.

@sebjf
Copy link
Member

sebjf commented Jan 25, 2024

Hi @TheBv, thank you for the update!

I did a quick test of versions 20.11.0 and 19.4.0 and was able to start with those. Do you have the exact version of 19 you were using so I can try it?

@TheBv
Copy link
Contributor Author

TheBv commented Jan 25, 2024

Node 19.4.0 with npm 9.2.0.
Also make sure you rerun npm install since changing versions seems to install different packages.
Happens both on Windows and Ubuntu.

@sebjf
Copy link
Member

sebjf commented Jan 25, 2024

OK I see the same thing now with 19.4.0 & npm 9.2.0.

It seems version 19.7.0 and above work again.

I will add the engines section to the package to prohibit this set of versions, as suggested!

sebjf added a commit that referenced this issue Jan 25, 2024
@sebjf
Copy link
Member

sebjf commented Jan 25, 2024

Done. Thanks for the reporting the issue!

@sebjf sebjf closed this as completed Jan 25, 2024
@sebjf sebjf removed their assignment Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants