I'm trying to customize <https://github.com/ory/hy...
# talk-hydra
a
I'm trying to customize https://github.com/ory/hydra-login-consent-node. In VSCode, it can't use import statements. I'm not terribly familiar with NodeJS. require statements work but objects show up as "any" (problematic if you have strict on). What's the best way to do development?
b
What do you mean "it can't use import statements"? do you have a TypeScript extension installed in VSCode?
a
Not aside from what's built in. As in "syntax error: cannot use import statement outside a module".
b
How do you try to run it? I just cloned the repo (Node 16 with yarn), then I ran
yarn install
then
yarn start
, the dev server started and I was able to open the browser, changed some code, refreshed and it went well
?
Did you try, by mistake, to run -
node app.js
a
Yeah, run with node.
b
The project is written in TypeScript, Node can't natively run it, can you instead run:
npm install
npm run start
See it if starts a web server on port 3000, if it does, try to modify a file and see if it affects
Might be worth to do some Node JS basic TypeScript express tutorial to understand what's going on. Although it's a small project, there is a lot happening under the hood, worth to understand if you plan to use it
a
I did run npm install to build the dependencies.
b
npm run start
starts a server?
a
Yeah now I seem to be getting somewhere. I had been calling app.ts directly.
👍 1
So my goal is to modify it a bit and use it in production. It seems to have out of date packages/critical vulnerabilities.
I assume I'd have to update and fix and breaking changes?
b
You may want to update it I guess, give it a try. JS libraries tend to get updated a lot
a
Alright.
One more dumb question: debugging. Figured it out: https://stackoverflow.com/a/67987617/1340075
Alright now I'm getting self signed cert error when hitting the Hydra admin URL. Fixed by directly setting process.env.NODE_TLS_REJECT_UNAUTHORIZED to "0". (Of course, will replace with a valid cert.)