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

Tesseract development version server throws 404 on localhost:3000 #874

Closed
Kishlay-notabot opened this issue Jan 16, 2024 · 8 comments
Closed

Comments

@Kishlay-notabot
Copy link
Contributor

Tesseract.js version (version number for npm/GitHub release, or specific commit for repo)
Latest version 5.0.4

Describe the bug
A clear and concise description of what the bug is.
After cloning the repo, running npm install and then npm start,
the command line shows up successful outputs but when I open the server link at http://localhost:3000/examples/browser/demo.html

To Reproduce
Steps to reproduce the behavior:

  1. Clone the repo
  2. Run npm install
  3. Run npm start
  4. Open localhost link

Expected behavior
Locahost dev server running succesfully

Device Version:

  • OS + Version: Windows 11
  • Browser: Edge
@Kishlay-notabot
Copy link
Contributor Author

Kishlay-notabot commented Jan 16, 2024

Running tesseract locally is getting very confusing.
In the docs I read about the dev server, and when i read the code I see mentions of the dist directory, but there is no dist directory to be seen.
Edit: dist directory seems to be in the CDN, sorry but im still confused
Someone please guide me and clear this fog over this, how to run tesseract independently, offline and please clear up all the mess of these different versions, node, browser and vanilla js [I've been using vanilla directly in npm and there seems to be no issue running the program, but in order to get a front end, I have to incorporate the html code]

@Kishlay-notabot
Copy link
Contributor Author

When I run tesseract using npm installation [basic node app (see code below)] and use a simple js only script, it downloads the respective .traineddata in the same folder,

const Ts = require("tesseract.js");

Ts.recognize('./tss.jpg', 'hin', {
  logger: e => console.log(e),
  tessedit_pageseg_mode: Ts.PSM.SINGLE_CHAR,
})
  .then(out => console.log(out))

but when we use browser mode, does the processing and unpacking happen in the cdn? Am i right?

@Balearica
Copy link
Member

This repo contains multiple examples, for both browser and Node.js. If you are having trouble getting started you should start by running those.

If you want to run Tesseract.js recognition entirely from your local server and/or local system, without trying to access a CDN, review the instructions in the documentation here.

The demo.html file your original post mentions does not exist, as it was replaced with other examples. I will update the documentation to remove any remaining references to this file now to avoid future confusion.

@Kishlay-notabot
Copy link
Contributor Author

This repo contains multiple examples, for both browser and Node.js. If you are having trouble getting started you should start by running those.

If you want to run Tesseract.js recognition entirely from your local server and/or local system, without trying to access a CDN, review the instructions in the documentation here.

The demo.html file your original post mentions does not exist, as it was replaced with other examples. I will update the documentation to remove any remaining references to this file now to avoid future confusion.

I did check the documentation and the examples, i tried to run the server, it it throwed up the cannot get error.
Thanks anyway, I'll recheck the links you have provided.

@Kishlay-notabot
Copy link
Contributor Author

Kishlay-notabot commented Jan 19, 2024

The demo.html file your original post mentions does not exist, as it was replaced with other examples. I will update the documentation to remove any remaining references to this file now to avoid future confusion.

The documentation mentioned that specific link, yes.

And,

This repo contains multiple examples, for both browser and Node.js. If you are having trouble getting started you should start by running those.

I did read these links, but where specifically is the /dist/ directory located?

@Kishlay-notabot
Copy link
Contributor Author

Kishlay-notabot commented Jan 19, 2024

Edit: the repo got updated, I'll try running it again. If it works, I'll close the issue

@Balearica
Copy link
Member

I did read these links, but where specifically is the /dist/ directory located? Where can I download the JS file package

Run npm run build to build the static files in the dist directory. This also happens automatically if you run npm start.

The example codes successfully work for the node installation, but I am facing trouble running it locally, and there is no proper or updated series of steps mentioned in the readme files to do it.

I do not understand what you mean by saying that the example code works but you were not able to run it locally.

@Kishlay-notabot
Copy link
Contributor Author

Kishlay-notabot commented Jan 19, 2024

I did read these links, but where specifically is the /dist/ directory located? Where can I download the JS file package

Run npm run build to build the static files in the dist directory. This also happens automatically if you run npm start.

The example codes successfully work for the node installation, but I am facing trouble running it locally, and there is no proper or updated series of steps mentioned in the readme files to do it.

I do not understand what you mean by saying that the example code works but you were not able to run it locally.

Sorry, I did not realize that Node version is also technically locally run . And yes thanks the local browser environment server now works.

Earlier I failed to realize that actually both are same.

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