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

Viewer not built in v0.15.x branch #825

Closed
flowrean opened this issue Jan 29, 2022 · 15 comments
Closed

Viewer not built in v0.15.x branch #825

flowrean opened this issue Jan 29, 2022 · 15 comments

Comments

@flowrean
Copy link
Contributor

Hi

When I build from source based on the v0.15.x branch, the embedded viewer does not seem to work. I see a blank page with a single link .keep instead of the fully functional UI I am used to seeing (using the latest Docker image v0.14.0).

Looking at the branches, this is probably due to the four commits that are in the master branch and the v0.14.0 release, but not in the v0.15.x branch. Maybe master should be merged into v0.15.x?

@iwpnd
Copy link
Member

iwpnd commented Jan 29, 2022

You can include the ui this way. @flowrean

@flowrean
Copy link
Contributor Author

flowrean commented Feb 2, 2022

@iwpnd Actually I am building a Docker image. It should include the UI, right?
From the master branch at tag v0.14.0, the UI works, but in v0.15.x it doesn't.
Do you know of a reason v0.15.x was not based on the most recent commit from master?

@ARolek
Copy link
Member

ARolek commented Feb 2, 2022

@flowrean I think this is related to the PR: #801. I re-opened that PR as there seems be a regression that I have not tracked down quite yet. What version of Go are you using? I think you're going to need to have npm installed and then run go generate ./... from the repo root to build the ui.

@iwpnd
Copy link
Member

iwpnd commented Feb 2, 2022

I can confirm the issue as I encountered the same forking v0.15.0 branch for my test image. @ARolek Following the guide in /ui fixed the issue and I was able to include it.

@flowrean
Copy link
Contributor Author

flowrean commented Feb 2, 2022

I think this is related to the PR: #801.

Ah yes, it seems something strange happened there.

What version of Go are you using? I think you're going to need to have npm installed and then run go generate ./... from the repo root to build the ui.

I am using Go 1.17.6. When running go generate ./... the npm run build errors for me but it is really a Docker image I am interested in. After merging master into v0.15.x locally, the UI indeed seems fixed in the image built from the Dockerfile in the repo root.

@iwpnd
Copy link
Member

iwpnd commented Feb 2, 2022

Don't bother with master as it is not the default branch of this project and is a couple of commits behind right now. If you want your image to have a ui, build it as I posted, then build the image. Since the Dockerfile copies everything in the workdir over prior to building tegola, the ui will be included.

@ARolek
Copy link
Member

ARolek commented Feb 2, 2022

Thanks for chiming in @iwpnd! We will make this easier going forward.

@flowrean
Copy link
Contributor Author

flowrean commented Feb 2, 2022

Thanks for your fast replies!

I tried to follow the guide, but the npm run build step fails:

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './2020/CreateDataProperty' is not defined by "exports" in /Users/flowrean/go/src/github.com/go-spatial/tegola/ui/node_modules/es-abstract/package.json

I don't have much experience with JS and wouldn't know what I could be doing wrong here, the instructions seem pretty straightforward.

I'm still a bit confused about the branches too. Master is indeed several commits behind, but it is also a few commits ahead.

@iwpnd
Copy link
Member

iwpnd commented Feb 3, 2022

I'm following the instructions to the point and do not run into issues.
It's safe to delete the node_modules directory and the package-lock.json and re-run npm install.

Again, don't worry about master. v0.15.x is the master/main of this repository. Think of it like a development branch only that you don't (necessarily) merge it in master in the end. Every new commit goes towards the v0.15.0 version. Once the maintainers bump the minor version and officially release 0.15.0, the default branch will probably change to v0.16.x.

@flowrean
Copy link
Contributor Author

flowrean commented Feb 3, 2022

When I follow the instructions literally, go-bindata cannot be found.

I can't help but notice some things related to go-bindata changed in this commit that is in v0.14.0 but not in v0.15.x: caf3fa8. Sorry to start about this again. I do understand the branching strategy but don't understand this:
Screenshot 2022-02-03 at 11 14 27

Here are the steps I found that eventually made it work:

rm -rf ui/package-lock.json ui/node_modules  # package-lock.json that is checked in won't do
go install -mod=vendor github.com/jteeuwen/go-bindata/go-bindata
go generate ./...
docker build -t tegola --build-arg VERSION=97ebfc0 .

So now the UI is included in the image. Thanks for the help!

@flowrean
Copy link
Contributor Author

flowrean commented Feb 3, 2022

My problem is solved but I'm leaving the issue open in case some changes should be done in the repo. Feel free to close it of course.

@ARolek
Copy link
Member

ARolek commented Feb 3, 2022

@flowrean thanks. Yeah the whole go-bindata part of this is a legacy artifact until we drop go 1.16 support. The PR I referenced addresses a build issue that users encounter when they're using Go 1.17+ which doesn't need go-bindata but instead uses go embed.

@iwpnd
Copy link
Member

iwpnd commented Feb 4, 2022

Can confirm the missing ui in gospatial/tegola:edge so I suspect it will also be missing on release of v0.15.0. :/

@iwpnd
Copy link
Member

iwpnd commented Feb 4, 2022

I tracked it down to this commit 1f3156. Prior to that ui would be included.

@ARolek
Copy link
Member

ARolek commented Apr 11, 2022

This is fixed in this pr: #843

@ARolek ARolek closed this as completed Apr 11, 2022
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

3 participants