We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Trying to use OCR from frontend using node-native-ocr package
The output is just recognize isn't exported from node-native-ocr (in the dev console)
recognize
Also tried to add this to the optimizeDeps exclusions array in the electron.vite.config.ts
Still no luck
I note that electron-vite 'doesn't support nodeIntegration' - I have also tried to plugin using commonjsExternals, but now it says
require is not defined
in the frontend.
This will be an interesting one...
The text was updated successfully, but these errors were encountered:
Content of electron.vite.config.ts
import { resolve } from 'path' import { defineConfig, externalizeDepsPlugin, bytecodePlugin } from 'electron-vite' import react from '@vitejs/plugin-react' import commonjsExternals from 'vite-plugin-commonjs-externals' let externals = ['node-native-ocr', 'babel-runtime', 'node-addon-api', 'prebuild-install'] export default defineConfig({ main: { plugins: [externalizeDepsPlugin(), bytecodePlugin()] }, preload: { plugins: [externalizeDepsPlugin(), bytecodePlugin()] }, renderer: { resolve: { alias: { '@renderer': resolve('src/renderer/src') } }, optimizeDeps: { exclude: externals }, plugins: [react(), commonjsExternals({ externals })] } })
Content of App.tsx relevant section:
recognize(my_img_here, (err: any, text: any)) => { if (err) { console.error(err) } else { console.log(text) } })
May have misplaced some brackets during transfer as I changed to my_img_here however rest assured the problem is not syntax.
my_img_here
Sorry, something went wrong.
No branches or pull requests
Trying to use OCR from frontend using node-native-ocr package
The output is just
recognize
isn't exported from node-native-ocr(in the dev console)
Also tried to add this to the optimizeDeps exclusions array in the electron.vite.config.ts
Still no luck
I note that electron-vite 'doesn't support nodeIntegration' - I have also tried to plugin using commonjsExternals, but now it says
require is not defined
in the frontend.
This will be an interesting one...
The text was updated successfully, but these errors were encountered: