allenai / pawls

Software that makes labeling PDFs easy.
https://pawls.apps.allenai.org
Apache License 2.0
380 stars 74 forks source link

Browserlist: caniuse-lite is outdated. Installation instructions are not clear. #173

Open Kaszanas opened 2 years ago

Kaszanas commented 2 years ago

While setting up PAWLS according to the instuctions in READMEthere are multiple errors and the documentation is not clear how to proceed with this software.

In the end when using docker-compose up the software builds but fails to start.

When attempting to visit the localhost:8080 the following error is shown:

pawls-ui-1      | Browserslist: caniuse-lite is outdated. Please run:
pawls-ui-1      | npx browserslist@latest --update-db
pawls-ui-1      |
pawls-ui-1      | Why you should do it regularly:
pawls-ui-1      | https://github.com/browserslist/browserslist#browsers-data-updating
pawls-api-1     | INFO:     172.19.0.6:44274 - "GET / HTTP/1.1" 204 No Content
pawls-ui-1      | Failed to compile.
pawls-ui-1      |
pawls-ui-1      | src/App.tsx
pawls-ui-1      |   Line 1:4:    Delete `␍`  prettier/prettier
pawls-ui-1      |   Line 2:69:   Delete `␍`  prettier/prettier
pawls-ui-1      |   Line 3:3:    Delete `␍`  prettier/prettier
pawls-ui-1      |   Line 4:82:   Delete `␍`  prettier/prettier
pawls-ui-1      |   Line 5:78:   Delete `␍`  prettier/prettier
codeviking commented 2 years ago

The browserlist error is a warning. I don't think it's what's actually causing a problem.

The other errors shown there are emitted by prettier, a tool we use for formatting. Based on the message, I think you might be trying to run things on windows.

You could try porting over this change, or removing the volumes from the docker-compose.yaml file:

-         volumes:
-             - ./ui/src:/usr/local/src/skiff/app/ui/src
-             - ./ui/public:/usr/local/src/skiff/app/ui/public
-             - ./ui/package.json:/usr/local/src/skiff/app/ui/package.json
-             - ./ui/tsconfig.json:/usr/local/src/skiff/app/ui/tsconfig.json
-             - ./ui/yarn.lock:/usr/local/src/skiff/app/ui/yarn.lock

I'd do that for both the api and ui services to see if it resolves the issue. My guess is there's something weird going on when mounting files from a Windows host into a Linux container (it looks like prettier is getting tripped up on the line end characters). But I could be wrong.

If that doesn't work you could try removing the .eslintrc file so that it'll use defaults that might not cause the problem you're running into. If you're not contributing fixes back here then you don't need to worry about running the formatter. If you do we can figure out what do once you've prepared a patch.

Sorry for the trouble! Let me know if either of these things help!

Kaszanas commented 2 years ago

Thank you for the response, I will try to apply the suggestions and verify if the software runs.

zeno17 commented 7 months ago

I tried the instructions above and they did not help.

Eventually, I got it running by going to the https://github.com/allenai/pawls/blob/main/ui/.eslintrc.js file and adding the following to the rules setting:

"prettier/prettier": ["error", {"requirePragma": true, } ]

The file finally looks like this

module.exports = { extends: ['@allenai/eslint-config-varnish'], rules: { 'eol-last': ['error', 'always'], "prettier/prettier": ["error", {"requirePragma": true, } ] }, };