docsql
docsql copied to clipboard
Server returns 404
I tried running docsql in a checkout of mdn/content, but the started server just returns "Not found":
% ls ✖ ✭
CODE_OF_CONDUCT.md README.md files netlify.toml out scripts
LICENSE.md REVIEWING.md meta node_modules package.json yarn.lock
% node --version 130 ↵ ✖ ✭
v16.15.0
% npx docsql --version 130 ↵ ✖ ✭
1.0.0
% npx docsql -v ./files 130 ↵ ✖ ✭
Sources are: ./files
5 plugins found.
7,206 files found in ./files.
Analyzing ████████████████████████████████████████ 100% | 7206/7206
> Ready on http://localhost:3000
![image](https://user-images.githubusercontent.com/495429/168671119-b2a52e24-0cbb-4d0a-828d-051ab87d0a75.png)
Any tips what might cause it?
Weird! It's just NextJS.
![Screen Shot 2022-05-17 at 10 24 25 AM](https://user-images.githubusercontent.com/26739/168834662-8dd9669d-3c7c-4474-8a41-022904be3637.png)
Perhaps you have a Service Worker on localhost:3000
from another project. Try different browsers or curl
. E.g.
▶ xh --headers http://localhost:3000
HTTP/1.1 200 OK
Connection: keep-alive
Content-Length: 7226
Content-Type: text/html;charset=utf-8
Date: Tue, 17 May 2022 14:25:14 GMT
Keep-Alive: timeout=5
Last-Modified: Mon, 28 Mar 2022 12:49:51 GMT
Unfortunately, I'm getting the same result in a different browser (Edge) without Service Worker (as per edge://serviceworker-internals/
), and with xh
:
% xh --headers http://localhost:3000 130 ↵ ✚
HTTP/1.1 404 Not Found
Connection: keep-alive
Content-Length: 9
Date: Tue, 17 May 2022 15:07:25 GMT
Keep-Alive: timeout=5
Might sound silly but, are you sure there's nothing bound to :3000 before you start it?
Yup, as soon as I terminate docsql, I no longer get any response and a timeout instead.
Bummer. Would you mind debugging it to see why it could be? If I'm not mistaken, it's just polka
running a folder called out
. So perhaps it's a because you haven't run npm run build
or npm run export
which I thought was part of the NPM package.
- :x: Running
npx docsql
with relative or absolute path - :x: Running
npm run run
from docsql checkout withCONTENT_SOURCES
in the environment - ✅ Running
npm run dev
from docsql checkout withCONTENT_SOURCES
in the.env
file
So the issue I'm experiencing could very well be the same as #80.
I really suspect that the out
directory is not being served correctly.
It's certainly in the NPM package.
▶ npm init -y && npm install docsql
...
▶ ls node_modules/docsql/out/
404.html _next favicon-16x16.png favicon-32x32.png favicon.ico index.html
Because when you try to run it now, it works:
▶ npx docsql /Users/peterbe/dev/MOZILLA/MDN/content/files
5 plugins found.
11,276 files found in /Users/peterbe/dev/MOZILLA/MDN/content/files.
Analyzing ████████████████████████████████████████ 100% | 11276/11276
> Ready on http://localhost:3000
^C
(yes, now http://localhost:3000 works)
So if you have some ideas how to make that work, I'm all ears.