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

can't build the frontend #800

Closed
windmaple opened this issue Jul 28, 2022 · 3 comments
Closed

can't build the frontend #800

windmaple opened this issue Jul 28, 2022 · 3 comments

Comments

@windmaple
Copy link
Collaborator

So I got the 404 error when running 'python -m lit_nlp.examples.quickstart_sst_demo --port=5432'

I0728 17:29:14.486322 140212950505280 _internal.py:224]  * Running on http://127.0.0.1:5432 (Press CTRL+C to quit)
W0728 17:30:32.438771 140212950505280 wsgi_app.py:55] IOError [Errno 2] No such file or directory: '/home/windmaple/Desktop/lit-main/lit_nlp/client/build/default/static/index.html' on path /home/windmaple/Desktop/lit-main/lit_nlp/client/build/default/static/index.html
I0728 17:30:32.439167 140212950505280 wsgi_app.py:145] path /home/windmaple/Desktop/lit-main/lit_nlp/client/build/default/static/index.html not found, sending 404
I0728 17:30:32.440300 140212950505280 _internal.py:224] 127.0.0.1 - - [28/Jul/2022 17:30:32] "GET / HTTP/1.1" 404 -
W0728 17:30:32.623247 140212950505280 wsgi_app.py:55] IOError [Errno 2] No such file or directory: '/home/windmaple/Desktop/lit-main/lit_nlp/client/build/default/favicon.ico' on path /home/windmaple/Desktop/lit-main/lit_nlp/client/build/default/favicon.ico
I0728 17:30:32.623596 140212950505280 wsgi_app.py:145] path /home/windmaple/Desktop/lit-main/lit_nlp/client/build/default/favicon.ico not found, sending 404
I0728 17:30:32.624297 140212950505280 _internal.py:224] 127.0.0.1 - - [28/Jul/2022 17:30:32] "GET /favicon.ico HTTP/1.1" 404 -

OK, need to build the frontend. After setting up the python env following the setup guide, I got the following error:

(lit-nlp) windmaple@windmaple:~/Desktop/lit-main$ pushd lit_nlp; yarn && yarn build; popd
~/Desktop/lit-main/lit_nlp ~/Desktop/lit-main
yarn install v1.22.19
warning package.json: License should be a valid SPDX license expression
warning lit-client@0.0.1: License should be a valid SPDX license expression
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.53s.
yarn run v1.22.19
warning package.json: License should be a valid SPDX license expression
$ yarn clean && webpack --env.production --config ./client/webpack/config.js
warning package.json: License should be a valid SPDX license expression
$ rm -rf ./client/build
⭐️ Packing web... { production: true }
Hash: d1683beea2b5dece0b54
Version: webpack 4.44.1
Time: 1212ms
Built at: 07/28/2022 5:33:39 PM
 1 asset
Entrypoint default = default/main.js
[0] ./client/default/main.ts 3.94 KiB {0} [built] [failed] [1 error]

ERROR in ./client/default/main.ts
Module build failed (from ./node_modules/ts-loader/index.js):
Error: Debug Failure. False expression: Non-string value passed to `ts.resolveTypeReferenceDirective`, likely by a wrapping package working with an outdated `resolveTypeReferenceDirectives` signature. This is probably not a problem in TS itself.
    at Object.resolveTypeReferenceDirective (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/typescript/lib/typescript.js:42537:18)
    at /home/windmaple/Desktop/lit-main/lit_nlp/node_modules/ts-loader/dist/servicesHost.js:373:77
    at /home/windmaple/Desktop/lit-main/lit_nlp/node_modules/ts-loader/dist/servicesHost.js:95:142
    at Array.map (<anonymous>)
    at Object.resolveTypeReferenceDirectives (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/ts-loader/dist/servicesHost.js:95:125)
    at actualResolveTypeReferenceDirectiveNamesWorker (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/typescript/lib/typescript.js:116674:163)
    at resolveTypeReferenceDirectiveNamesWorker (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/typescript/lib/typescript.js:116974:26)
    at processTypeReferenceDirectives (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/typescript/lib/typescript.js:118456:31)
    at findSourceFileWorker (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/typescript/lib/typescript.js:118341:21)
    at findSourceFile (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/typescript/lib/typescript.js:118196:26)
    at processImportedModules (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/typescript/lib/typescript.js:118602:25)
    at findSourceFileWorker (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/typescript/lib/typescript.js:118347:17)
    at findSourceFile (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/typescript/lib/typescript.js:118196:26)
    at processImportedModules (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/typescript/lib/typescript.js:118602:25)
    at findSourceFileWorker (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/typescript/lib/typescript.js:118347:17)
    at findSourceFile (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/typescript/lib/typescript.js:118196:26)
    at processImportedModules (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/typescript/lib/typescript.js:118602:25)
    at findSourceFileWorker (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/typescript/lib/typescript.js:118347:17)
    at findSourceFile (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/typescript/lib/typescript.js:118196:26)
    at /home/windmaple/Desktop/lit-main/lit_nlp/node_modules/typescript/lib/typescript.js:118148:85
    at getSourceFileFromReferenceWorker (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/typescript/lib/typescript.js:118114:34)
    at processSourceFile (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/typescript/lib/typescript.js:118148:13)
    at processRootFile (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/typescript/lib/typescript.js:117949:13)
    at /home/windmaple/Desktop/lit-main/lit_nlp/node_modules/typescript/lib/typescript.js:116765:67
    at Object.forEach (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/typescript/lib/typescript.js:377:30)
    at Object.createProgram (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/typescript/lib/typescript.js:116765:16)
    at synchronizeHostData (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/typescript/lib/typescript.js:165086:26)
    at Object.getProgram (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/typescript/lib/typescript.js:165218:13)
    at successfulTypeScriptInstance (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/ts-loader/dist/instances.js:178:80)
    at Object.getTypeScriptInstance (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/ts-loader/dist/instances.js:34:12)
    at Object.loader (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/ts-loader/dist/index.js:17:41)
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
~/Desktop/lit-main

I'm using a fresh Ubuntu 22.04 image and yarn 1.22.19. A quick Google search on that error says something about ts-node version being out of date. I'm not sure how to fix this.

@jameswex
Copy link
Collaborator

What version of TypeScript are you using? If its 4.7, looks like you could downgrade to 4.6, or update your ts-node package version as you mentioned (https://stackoverflow.com/questions/72488958/false-expression-non-string-value-passed-to-ts-resolvetypereferencedirective)

@windmaple
Copy link
Collaborator Author

windmaple commented Jul 29, 2022

Downgraded TS to 4.6.4 and ts-node to 10.8.1. Unfortunately it didn't help. Very strange.

(lit-nlp) windmaple@windmaple:~/Desktop/lit-main$ tsc -v
Version 4.6.4
(lit-nlp) windmaple@windmaple:~/Desktop/lit-main$ cat package.json 
{
  "dependencies": {
    "ts-loader": "^9.3.1",
    "ts-node": "^10.8.1",
    "ts-node-dev": "^2.0.0",
    "typescript": "^4.6.4"
  }
}
(lit-nlp) windmaple@windmaple:~/Desktop/lit-main$ pushd lit_nlp; yarn && yarn build; popd
~/Desktop/lit-main/lit_nlp ~/Desktop/lit-main
yarn install v1.22.19
warning package.json: License should be a valid SPDX license expression
warning lit-client@0.0.1: License should be a valid SPDX license expression
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.88s.
yarn run v1.22.19
warning package.json: License should be a valid SPDX license expression
$ yarn clean && webpack --env.production --config ./client/webpack/config.js
warning package.json: License should be a valid SPDX license expression
$ rm -rf ./client/build
⭐️ Packing web... { production: true }
Hash: d1683beea2b5dece0b54
Version: webpack 4.44.1
Time: 1207ms
Built at: 07/29/2022 1:10:03 PM
 1 asset
Entrypoint default = default/main.js
[0] ./client/default/main.ts 3.94 KiB {0} [built] [failed] [1 error]

ERROR in ./client/default/main.ts
Module build failed (from ./node_modules/ts-loader/index.js):
Error: Debug Failure. False expression: Non-string value passed to `ts.resolveTypeReferenceDirective`, likely by a wrapping package working with an outdated `resolveTypeReferenceDirectives` signature. This is probably not a problem in TS itself.
    at Object.resolveTypeReferenceDirective (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/typescript/lib/typescript.js:42537:18)
    at /home/windmaple/Desktop/lit-main/lit_nlp/node_modules/ts-loader/dist/servicesHost.js:373:77
    at /home/windmaple/Desktop/lit-main/lit_nlp/node_modules/ts-loader/dist/servicesHost.js:95:142
    at Array.map (<anonymous>)
    at Object.resolveTypeReferenceDirectives (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/ts-loader/dist/servicesHost.js:95:125)
    at actualResolveTypeReferenceDirectiveNamesWorker (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/typescript/lib/typescript.js:116674:163)
    at resolveTypeReferenceDirectiveNamesWorker (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/typescript/lib/typescript.js:116974:26)
    at processTypeReferenceDirectives (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/typescript/lib/typescript.js:118456:31)
    at findSourceFileWorker (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/typescript/lib/typescript.js:118341:21)
    at findSourceFile (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/typescript/lib/typescript.js:118196:26)
    at processImportedModules (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/typescript/lib/typescript.js:118602:25)
    at findSourceFileWorker (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/typescript/lib/typescript.js:118347:17)
    at findSourceFile (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/typescript/lib/typescript.js:118196:26)
    at processImportedModules (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/typescript/lib/typescript.js:118602:25)
    at findSourceFileWorker (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/typescript/lib/typescript.js:118347:17)
    at findSourceFile (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/typescript/lib/typescript.js:118196:26)
    at processImportedModules (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/typescript/lib/typescript.js:118602:25)
    at findSourceFileWorker (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/typescript/lib/typescript.js:118347:17)
    at findSourceFile (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/typescript/lib/typescript.js:118196:26)
    at /home/windmaple/Desktop/lit-main/lit_nlp/node_modules/typescript/lib/typescript.js:118148:85
    at getSourceFileFromReferenceWorker (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/typescript/lib/typescript.js:118114:34)
    at processSourceFile (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/typescript/lib/typescript.js:118148:13)
    at processRootFile (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/typescript/lib/typescript.js:117949:13)
    at /home/windmaple/Desktop/lit-main/lit_nlp/node_modules/typescript/lib/typescript.js:116765:67
    at Object.forEach (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/typescript/lib/typescript.js:377:30)
    at Object.createProgram (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/typescript/lib/typescript.js:116765:16)
    at synchronizeHostData (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/typescript/lib/typescript.js:165086:26)
    at Object.getProgram (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/typescript/lib/typescript.js:165218:13)
    at successfulTypeScriptInstance (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/ts-loader/dist/instances.js:178:80)
    at Object.getTypeScriptInstance (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/ts-loader/dist/instances.js:34:12)
    at Object.loader (/home/windmaple/Desktop/lit-main/lit_nlp/node_modules/ts-loader/dist/index.js:17:41)
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
~/Desktop/lit-main

@windmaple
Copy link
Collaborator Author

windmaple commented Jul 30, 2022

Ended up using gunicorn to run it and it worked. Not sure why.

Btw, I also tried the Dockerfile and it failed w/ the same error. So I don't think the issue is with my setup.

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

2 participants