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

[restart] t2 restart is broken #675

Closed
johnnyman727 opened this issue Apr 15, 2016 · 6 comments
Closed

[restart] t2 restart is broken #675

johnnyman727 opened this issue Apr 15, 2016 · 6 comments

Comments

@johnnyman727
Copy link
Contributor

t2 restart returns:

➜  ambient-attx4 git:(master) t2 restart
INFO Looking for your Tessel...
INFO Connected to Tessel-02A3BBAD6C82.
INFO Running undefined...
module.js:339
    throw err;
    ^

Error: Cannot find module '/tmp/remote-script/undefined'
    at Function.Module._resolveFilename (module.js:337:15)
    at Function.Module._load (module.js:287:25)
    at Function.Module.runMain (module.js:467:10)
    at startup (node.js:134:18)
    at node.js:961:3

We need some better unit tests as well.

@johnnyman727
Copy link
Contributor Author

I haven't been able to make a `reproducible test case for the error message described above, but I did find an unaddressed corner case. My directory structure looks like

ambient-attx4
--debug
----update.js
--node_modules
--index.js
--OTHER_STUFF

If I run t2 run debug/update.js, and then run t2 restart, it will not run the script I previously ran because it delegates to Node to determine the entrypoint for the file which will not be the script I just ran. Not sure if we can fix this case though.

@johnnyman727
Copy link
Contributor Author

johnnyman727 commented Apr 15, 2016

Okay, steps to reproduce the first error message are simple:

t2 init
t2 run index.js
^C after lights start blinking
t2 restart
[FAILURE]

@rwaldron
Copy link
Contributor

I've never seen t2 restart without an entry point, ie. t2 restart index.js. How is t2 restart supposed to know which file to start with from one run to another?

@rwaldron
Copy link
Contributor

The real bug is that it allows you to get that far without displaying an error

@rwaldron
Copy link
Contributor

In addition to my previous two comments, I'm actually seeing another issue: there is no package.json, which is what gets used to determine what to run when you type t2 restart with no entry point (I had actually forgotten about this.)

If I run t2 run debug/update.js, and then run t2 restart, it will not run the script I previously ran because it delegates to Node to determine the entrypoint for the file which will not be the script I just ran. Not sure if we can fix this case though.

Not without writing some state, which we can do, but it's new territory.

@rwaldron
Copy link
Contributor

TBH, looking in the package.json is probably too much of an assumption and I think we should drop that fallback.

rwaldron added a commit that referenced this issue Apr 15, 2016
This needs to be used by preferences.js

Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
rwaldron added a commit that referenced this issue Apr 15, 2016
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
rwaldron added a commit that referenced this issue Apr 15, 2016
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
rwaldron added a commit that referenced this issue Apr 15, 2016
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
rwaldron added a commit that referenced this issue Apr 15, 2016
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
rwaldron added a commit that referenced this issue Apr 15, 2016
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
rwaldron added a commit that referenced this issue Apr 16, 2016
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
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