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

Standard Notes web app fails to build on arm64 due to TS2774 #1880

Closed
rustysys-dev opened this issue Feb 24, 2021 · 17 comments
Closed

Standard Notes web app fails to build on arm64 due to TS2774 #1880

rustysys-dev opened this issue Feb 24, 2021 · 17 comments
Assignees
Labels
help wanted Support request

Comments

@rustysys-dev
Copy link

rustysys-dev commented Feb 24, 2021

I am trying to compile the Standard Notes web app on arm64 and am running into an issue. Officially I am running the docker-compose but only wanted to post the relevant error and so below is output from the specific compile instruction that produces the error that I am running into.

$ tsc --project app/assets/javascripts/tsconfig.json
app/assets/javascripts/routes.ts:6:27 - error TS2774: This condition will always return true since the function is always defined. Did you mean to call it instead?

6     if (window.history && window.history.pushState) {
                            ~~~~~~~~~~~~~~~~~~~~~~~~


Found 1 error.

error Command failed with exit code 2.

It seems since these are just defined objects, the fact that they exists means that the if block will always return true. This seems to be an error in typescript where it prevents compilation.

Any ideas on how can I get past this?

Relevant code:

https://github.com/standardnotes/web/blob/1852b5e0454efe7aac369fd43201f6ff1037c405/app/assets/javascripts/routes.ts#L6

@JaspalSuri JaspalSuri added the help wanted Support request label Feb 24, 2021
@JaspalSuri
Copy link

Hi @rustysys-dev,

I've assigned this thread for our web app dev to look into. 🙂 You can usually expect a response within a couple of days, but the dev team is wrapping up a new release so it may take a bit longer to hear back from someone.

@rustysys-dev
Copy link
Author

rustysys-dev commented Feb 24, 2021

Hi @rustysys-dev,

I've assigned this thread for our web app dev to look into. slightly_smiling_face You can usually expect a response within a couple of days, but the dev team is wrapping up a new release so it may take a bit longer to hear back from someone.

Definitely! I can't wait to hear back.

As I see it, it seems like the if statement is checking something (feautres?) in order to decide whether or not to activate html5 or not... but I didn't check to see how this can fail. I think that is what typescript is expecting...

In any case I hope to hear from someone soon 😃

@arielsvg
Copy link

Hey @rustysys-dev!
If you want to build the front-end locally you should first run  yarn setup and then yarn bundle. Though I would recommend trying our docker setup first, since it's what we also use ourselves to host the web app. 🙂

@arielsvg
Copy link

arielsvg commented Feb 25, 2021

Oh and if you just want to run the web app locally for development purposes I recommend looking at the Running locally section of the repo!

@rustysys-dev
Copy link
Author

rustysys-dev commented Feb 26, 2021

@baptiste-grob was building the docker container and got this error. I would use a prebuilt image, but i dont see one for ARM.

What you see in the code block was me verifying the error after the docker container build failed.

@rustysys-dev
Copy link
Author

Are there special requirements for building on an arm platform?

@JaspalSuri
Copy link

Hi @rustysys-dev, have you already tried the arm64 Docker image?

For the desktop app, there was an unmet dependency (or dependencies) that prevent it from being built at the moment.

@rustysys-dev
Copy link
Author

@JaspalSuri I think maybe I have a misunderstanding. It seems that the link that you have provided was for standardnotes/sync-server and not standardnotes/web. From my understanding the server just contains the API for the project while the web contains the front-end.. Is this assumption incorrect?

Also I apologize if I said anything that was indicative of me trying to use the desktop app? I am not. I am trying to deploy the following.

  • sync-server
  • db
  • cache
  • web

Looking at the dockerhub for sync-server, indeed it supports arm64, but the dockerhub for web only seems to show an arch of amd64. Trying that image on my arm server doesn't produce a working container. As such I was looking to build the standardnotes/web container.

If I have a misunderstanding please let me know, but Is there a way to get standardnotes/web deployed to arm64?

@JaspalSuri
Copy link

JaspalSuri commented Feb 28, 2021

Hi @rustysys-dev, thank you for your considerate response! I apologize for the misunderstanding on my part and for conflating the desktop app with the web app. An arm64 version of the Standard Notes web app is currently not possible.

@rustysys-dev
Copy link
Author

@JaspalSuri Thank you for your response! I have one last set of questions.

  1. Is there a specific reason/issue that is being faced as to why the Standard Notes web app on arm64 is currently not possible?

  2. Is making Standard Notes web app work with arm64 currently on the roadmap somewhere?

@rustysys-dev rustysys-dev changed the title Typescript fails to build due to TS2774 Typescript fails to build on arm64 due to TS2774 Feb 28, 2021
@rustysys-dev rustysys-dev changed the title Typescript fails to build on arm64 due to TS2774 Standard Notes web app fails to build on arm64 due to TS2774 Feb 28, 2021
@JaspalSuri
Copy link

JaspalSuri commented Mar 2, 2021

@rustysys-dev

Regarding your first question, I got in touch with someone from the dev team and they said that it might be possible to build the web app with some adjustments. I had mistakenly assumed that similar to the desktop app, there were some unmet dependencies.

Regarding your second question, it's currently not on our roadmap, but I'll put in a request for review. 😃 The reason why it's not on our roadmap could be because the web app currently runs on devices like a Raspberry Pi and someone who is self-hosting can sign into their server instead of the Standard Notes' server.

@rustysys-dev
Copy link
Author

@JaspalSuri Thats awesome! Thanks for getting in touch with the dev team! It would be really great to see this working! :)

The reason why it's not on our roadmap could be because the web app currently runs on devices like a Raspberry Pi and someone who is self-hosting can sign into their server instead of the Standard Notes' server.

Are you refering to the syncing-server here? As far as I know the Raspberry Pi 4 at least is arm64, so I would expect Standard Notes web app wouldn't build there either? Raspberry Pi 3 is armhf (32 bit + hardware based floating point instructions) so I cannot speak for it.

@JaspalSuri
Copy link

JaspalSuri commented Mar 3, 2021

I apologize again if I'm misunderstanding, but the web app currently runs within a web browser on a Raspberry Pi. Are you looking for something like a headless client?

@rustysys-dev
Copy link
Author

rustysys-dev commented Mar 3, 2021

I apologize again if I'm misunderstanding, but the web app currently runs within a web browser on a Raspberry Pi. Are you looking for something like a headless client?

Sorry I understood your meaning to be that there are people serving the web app from a Raspberry Pi, my misunderstanding.

I plan on eventually serving both the syncing-server and the web app from an arm64 server.

I will have clients connect to for example notes.rustysys.dev in order to access the web app, the backend will exist at sync.rustysys.dev both of which will be routed to the same physical arm64 server.

@JaspalSuri
Copy link

I understand what you mean now; thank you for clarifying!

@arielsvg
Copy link

I don't know how our build process didn't catch this earlier but I fixed this check on our develop, so you'll get to use it next time we publish a version to production (main branch) 🙂

@minozheros
Copy link

The local App builds on Arm64 Raspberry Pi and it seems to work too.. The docker container does not work though

@moughxyz moughxyz transferred this issue from standardnotes/app Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Support request
Projects
None yet
Development

No branches or pull requests

4 participants