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.

Windows support (i.e. directly via cmd.exe or powershell, not WSL)

See original GitHub issue

Having a tsconfig.json results in:

...\build.js: ReferenceError: prog is not defined
    at ...\node_modules\estrella\dist\estrella.js:2:12202
    at new Promise (<anonymous>)
    at V (...\node_modules\estrella\dist\estrella.js:2:11825)
    at n (...\node_modules\estrella\dist\estrella.js:2:6134)
    at Aa (...\node_modules\estrella\dist\estrella.js:25:4614)
    at ...\node_modules\estrella\dist\estrella.js:25:1271
    at new Promise (<anonymous>)
    at da (...\node_modules\estrella\dist\estrella.js:25:1228)
    at build (...\node_modules\estrella\dist\estrella.js:26:801)
    at Object.<anonymous> (...\build.js:3:1)

Which I assume might actually be a bug in esbuilds minification. The distributed estrella.js does not define prog (I’m thinking the name was minified but this reference was not). Edit: it is actually never defined in the source

The actual error it was trying to print refers to “tsc” not being found in path. I actually see a windows check here but it’s not used further down in the function. As a note, I installed typescript through yarn locally which actually creates a ./node_modules/.bin/tsc.cmd file (not exe).

https://github.com/rsms/estrella/blob/6d54414c235a22b1b5a710b73cc63aca07d8708c/src/util.js#L18

Messing around to see the message also led me to find this (a + was forgotten here since we get a runtime TypeError: "." is not a function):

https://github.com/rsms/estrella/blob/6d54414c235a22b1b5a710b73cc63aca07d8708c/src/tslint.js#L89-L90

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
benmerckxcommented, Jul 16, 2020

One more Windows issue: X_OK flag will not be available. Here’s what works for me: https://github.com/benmerckx/estrella/commit/6f62e60ebd3de880f55ba9c6103ed22e292ce034 Not sure if I can PR this since: prog probably came from the estrella module before a refactor but importing would create circular imports so I just removed it. And I’m very unsure what should happen in a PATH lookup on Windows regarding extensions.

0reactions
benmerckxcommented, Sep 30, 2020

A few notes on trying the latest version. Building a project results in:

Unhandled exception: Error: spawn ...\node_modules\.bin\tsc ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
    at onErrorNT (internal/child_process.js:469:16)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)

Pulling in the latest git changes proved a little difficult. Apparently windows does not allow files named aux regardless the extension (https://stackoverflow.com/a/61616948).

Building estrella gave me the same error as above. Fiddling in the minified code a little gave me this insight:

https://github.com/rsms/estrella/blob/4ead3b90b6ad5747819cf813a29280ce3432d6e4/src/tslint.js#L88 tsprog here is the string: “C:\projects\estrella\node_modules.bin\tsc”

Seems that path came from here: https://github.com/rsms/estrella/blob/4ead3b90b6ad5747819cf813a29280ce3432d6e4/src/tsutil.ts#L34

When I add the (.cmd) extension there as well all works as expected.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Working across Windows and Linux file systems
Run Linux tools from a Windows command line. Run Linux binaries from the Windows Command Prompt (CMD) or PowerShell using wsl <command> (or...
Read more >
How can I run a Windows executable from WSL (Ubuntu) Bash
wrun : call a win-executable synchronously with CreateProcess , and wait to die (not using cmd.exe ). wstart : launch a detached (asynchronously)...
Read more >
wsl.exe --install not running · Issue #1054 - GitHub
WSL does not require Windows Store access (as of now). You can install distribution using wsl --import command or using the launcher exe...
Read more >
CUDA on WSL User Guide - NVIDIA Documentation Center
CUDA support in this user guide is specifically for WSL 2, ... Dual Boot i.e. install Linux and Windows in separate partitions on...
Read more >
The Ultimate Guide to Windows Subsystem for Linux ...
To start using WSL, open up a PowerShell terminal and type wsl . If you've set up WSL correctly, you'll enter a bash...
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