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

"make" generates erroneous javascript in github master #729

Open
gwhitney opened this issue Jul 21, 2020 · 2 comments · May be fixed by #730
Open

"make" generates erroneous javascript in github master #729

gwhitney opened this issue Jul 21, 2020 · 2 comments · May be fixed by #730

Comments

@gwhitney
Copy link

gwhitney commented Jul 21, 2020

Today I checked out the current master from this repository (commit f73313 to be exact), and in the resulting directory executed npm i and then ./bin/ethercalc. Pointing my browser at http://localhost:8000, all seems well: the start page loads fine, and the create spreadsheet button works fine and produces apparently working spreadsheets.

If I then make some trivial change to src/main.ls (changing _start to _mystart, say), it of course has no effect on the running ethercalc server, as that's controlled by the .js files generated from the LiveScript. So then if one executes make in the main ethercalc directory (first it fails due to an outdated installation of uglify-js, which can easily be corrected with npm install uglify-js) it generates new .js files. Restarting the ethercalc server, one observes that the change has been put into effect (the server now responds to http://localhost:8000/_mystart, which it did not before) but sadly that now any attempt to open a new or existing spreadsheet loops infinitely with a "TypeError: SocialCalc.Sheet is undefined" JavaScript exception.

Perhaps there is some bug in the Makefile? Or perhaps "make" is no longer the recommended way to rebuild from modified sources? If the latter, and if someone could explain what the best way to rebuild is, I'd be happy to submit a PR updating the installation documentation.

Note this issue may well be a duplicate of #175, but since I think this report encapsulates the difficulty more narrowly, and it's been five years anyway, I decided go ahead and post this separately. Happy to close in favor of continuing any efforts on this in #175 if that's preferred. Thank you very much for your time.

@eddyparkinson
Copy link
Collaborator

How to pin down the cause?

Make has undergone many changes over the years, it is possible an error exists.

I would suggest you test by changing a string or making some other cosmetic change. The name of a menu for example or a log message.

It is very possible that some other section of code depends on _start

If it still has an error, it would help to find the "erroneous javascript" ?

pull requests are welcome.

@gwhitney gwhitney linked a pull request Jul 22, 2020 that will close this issue
@gwhitney
Copy link
Author

OK, I think I tracked it down to changes in the command-line arguments for uglifyjs, and have submitted a pull request as suggested.

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

Successfully merging a pull request may close this issue.

2 participants