Go embed fails to find index.html or *.js files

Hello @brocaar !
I’m really new to all of this, by the way thank you for your great job!

I’m trying to execute chirpstack application server from source code. What I’ve done:

  1. Cloned chirpstack app server
  2. Executed make build command in app server directory
  3. Got an error:
    static/static.go:6:75: pattern *.html: no matching files found
    make: *** [Makefile:7: build] Ошибка 1
  4. Can’t understand how to solve this error, bcs it seems to be okay for others…
  5. I’ve go version go1.16 linux/amd64 installed

Hii @Muslimah

before execute make build please run the below command to install the UI dependency.

make dev-requirements
make ui-requirements

Thank you for so quick response! :+1: I really appreciate your help!
I had errors while trying to execute make ui-requirements command, that I couldn’t solve using npm audit fix or npm audit fix --force. However, execution of these commands in the ui directory fixed the issue. By the way, is it okay to do so? :sweat_smile:

But unfortunately, I still have go embed error((

$ make ui-requirements 
Installing UI requirements
up to date, audited 2121 packages in 8s

129 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
$ make build
Building ui

> chirpstack-application-server-ui@3.0.0 build
> react-scripts build

Creating an optimized production build...
Compiled successfully.

File sizes after gzip:

  470.45 KB  build/static/js/2.c34da569.chunk.js
  52.03 KB   build/static/js/main.97a28eae.chunk.js
  23.56 KB   build/static/css/2.e72d3014.chunk.css
  791 B      build/static/js/runtime-main.33db2bcb.js
  116 B      build/static/css/main.3f9ef032.chunk.css

The project was built assuming it is hosted at /.
You can control this with the homepage field in your package.json.

The build folder is ready to be deployed.
You may serve it with a static server:

  npm install -g serve
  serve -s build

Find out more about deployment here:

  https://cra.link/deployment

Fetching Swagger definitions and generate combined Swagger JSON
Клонирование в «/tmp/chirpstack-api»…
remote: Enumerating objects: 3777, done.
remote: Counting objects: 100% (171/171), done.
remote: Compressing objects: 100% (133/133), done.
remote: Total 3777 (delta 78), reused 94 (delta 31), pack-reused 3606
Получение объектов: 100% (3777/3777), 2.68 MiB | 319.00 KiB/s, готово.
Определение изменений: 100% (2406/2406), готово.
Note: switching to 'v3.9.5'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD сейчас на a49efdc Add ReEncryptDeviceQueueItems method on AS interface.
mkdir -p build
go build  -ldflags "-s -w -X main.version=3.15.0-test.1-1-g5384962" -o build/chirpstack-application-server cmd/chirpstack-application-server/main.go
static/static.go:6:82: pattern *.js: no matching files found
make: *** [Makefile:7: build] Ошибка 1

I tried to run it using docker (docker-compose run --rm chirpstack-application-server bash ), the same result :pensive:

go build -a -installsuffix cgo -ldflags "-s -w -X main.version=3.15.0-test.1-1-g5384962" -o build/chirpstack-application-server cmd/chirpstack-application-server/main.go
static/static.go:6:82: pattern *.js: no matching files found
make: *** [Makefile:7: build] Error 1

I realized now this problem occured since the Refactor SQL schema migrations from sql-migrate to golang-migrate + U… commit has been done.

I did the hard reset to previous commit. It did the trick for me and now app server is successfully running on my localhost.

Hii @Muslimah

I have clone chirpstack-application-server and perform the build step and it’s working fine.

$ make build
Building ui

> chirpstack-application-server-ui@3.0.0 build E:\chirpstack-application-server\ui
> react-scripts build

Creating an optimized production build...
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db
Compiled successfully.

File sizes after gzip:

  454.24 KB  build\static\js\2.7e037a47.chunk.js
  51.08 KB   build\static\js\main.27461f3b.chunk.js
  23.57 KB   build\static\css\2.ff340785.chunk.css
  789 B      build\static\js\runtime-main.ce245b8e.js
  116 B      build\static\css\main.a2b7b0b6.chunk.css

The project was built assuming it is hosted at /.
You can control this with the homepage field in your package.json.

The build folder is ready to be deployed.
You may serve it with a static server:

  npm install -g serve
  serve -s build

Find out more about deployment here:

  bit.ly/CRA-deploy

Fetching Swagger definitions and generate combined Swagger JSON
Cloning into '/tmp/chirpstack-api'...
remote: Enumerating objects: 3777, done.
remote: Counting objects: 100% (171/171), done.
remote: Compressing objects: 100% (133/133), done.
remote: Total 3777 (delta 78), reused 94 (delta 31), pack-reused 3606
Receiving objects: 100% (3777/3777), 2.68 MiB | 975.00 KiB/s, done.
Resolving deltas: 100% (2406/2406), done.
Note: switching to 'v3.9.5'.

You are in a 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at a49efdc Add ReEncryptDeviceQueueItems method on AS interface.
mkdir -p build
go build  -ldflags "-s -w -X main.version=3.15.0-test.1-2-g6eb051c" -o build/chirpstack-application-server cmd/chirpstack-application-server/main.go