question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

node-js examples not compiling

See original GitHub issue

To try and run the examples I do the following with a freshly cloned repo:

cd examples/examples-nodejs
npm i
tsc faceDetection.ts

I get the following error:

node_modules/@types/webgl2/index.d.ts:582:13 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'WebGL2RenderingContext' must be of type '{ new (): WebGL2RenderingContext; prototype: WebGL2RenderingContext; readonly ACTIVE_ATTRIBUTES: number; readonly ACTIVE_TEXTURE: number; ... 556 more ...; readonly WAIT_FAILED: number; }', but here has type '{ new (): WebGL2RenderingContext; prototype: WebGL2RenderingContext; readonly ACTIVE_ATTRIBUTES: number; readonly ACTIVE_TEXTURE: number; ... 557 more ...; readonly MAX_CLIENT_WAIT_TIMEOUT_WEBGL: number; }'.

582 declare var WebGL2RenderingContext: {
                ~~~~~~~~~~~~~~~~~~~~~~

  ../../../../../../usr/lib/node_modules/typescript/lib/lib.dom.d.ts:16485:13
    16485 declare var WebGL2RenderingContext: {
                      ~~~~~~~~~~~~~~~~~~~~~~
    'WebGL2RenderingContext' was also declared here.


Found 1 error.

I have the following: tsc --version: 3.7.2 node --version: 12.13.0

I have tried adding skipLibCheck: true to tsconfig.json but it did not do any difference.

Do you have any idea why it is not working for node?

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:7
  • Comments:18 (1 by maintainers)

github_iconTop GitHub Comments

29reactions
sbocconicommented, Dec 30, 2019

The solution was to first run

npm i && npm run-script build

in the root directory before trying to run the examples.

3reactions
FerXcommented, Dec 4, 2019

This command compile. tsc --skipLibCheck faceDetection.ts But then it doesn’t work

error:

UnhandledPromiseRejectionWarning: TypeError: this.backend.register is not a function
    at Engine.registerTensor (/home/ff/nodejs/face-api.js/node_modules/@tensorflow/tfjs-core/dist/engine.js:468:30)
Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - nodejs not compiling unimported files, even if such ...
I am importing my files using require(path + ".js") where path is a variable specified at runtime. Since the files specified in path...
Read more >
Node.JS Compiling error - visual studio - Super User
So I want to compile a nodejs project to one windows executable so I ... You should commit this file. npm WARN default@1.0.0...
Read more >
Compiling a Node.js Application into an .exe File - Section.io
In this tutorial, we'll learn how to create executable files for our Node.js application. Then, we'll compile our JavaScript files into an ...
Read more >
Errors | Node.js v19.3.0 Documentation
For all EventEmitter objects, if an 'error' event handler is not provided, the error will be thrown, causing the Node.js process to report...
Read more >
Why the Hell Would I Use Node.js? A Case-by-case Tutorial
You can significantly ease the development of an application that does not require CPU-intensive computation, by using Javascript to build it top to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found