server icon indicating copy to clipboard operation
server copied to clipboard

Failed to build UI

Open danielwangksu opened this issue 5 years ago • 2 comments

Have you read the documentation?

  • [x] Yes, but it does not include related information regarding my question.
  • [ ] Yes, but the steps described in the documentation do not work on my machine.
  • [ ] Yes, but I am having difficulty understanding it and wants clarification.

Any errors, logs, or other information that might help us identify your problem

Ex: docker-compose.yml, nginx.conf, android logcat, browser requests, etc.

Failed to build ui on macOS
Running `yarn build` under ui directory, I got the following error:
```
yarn run v1.22.10
$ react-scripts build
It looks like you're trying to use TypeScript but do not have typescript installed.
Please install typescript by running yarn add typescript.
If you are not trying to use TypeScript, please remove the tsconfig.json file from your package root (and any TypeScript files).

error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.


Following the instruction I executed `yarn add typescript` this changed typescript version in package.json and yarn.lock then I encountered another issue with `yarn build`:

TypeScript error in server/ui/src/tests/setup.ts(53,84): Expected 1 arguments, but got 0. Did you forget to include 'void' in your type argument to 'Promise'? TS2794

51 |             await Promise.all([
52 |                 browser.close(),

53 | new Promise((resolve) => kill(gotifyInstance.pid, 'SIGKILL', () => resolve())), | ^ 54 | ]); 55 | rimraf.sync(gotifyFile, {maxBusyTries: 8}); 56 | },

error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

 
</pre></details>

danielwangksu avatar Jan 09 '21 07:01 danielwangksu

Please try again with a clean working directory by reverting changes to package.json & yarn.lock.

$ git reset --hard
$ yarn install --frozen-lockfile
$ yarn build

Don't install typescript with yarn add, this will install a newer version of typescript that may not work with Gotify.

jmattheis avatar Jan 09 '21 09:01 jmattheis

Thank you very much @jmattheis

danielwangksu avatar Jan 09 '21 17:01 danielwangksu