-
-
Notifications
You must be signed in to change notification settings - Fork 499
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
Worker not working in production build #378
Comments
Seems to be this line: flexsearch/src/worker/index.js Line 138 in 9abb781
The first parameter for |
So here would be a workaround: const path = require('node:path')
const { Worker } = require('flexsearch')
function createWorker() {
const cwd = process.cwd()
try {
process.chdir(path.dirname(require.resolve('flexsearch')))
return new Worker()
} finally {
process.chdir(cwd)
}
}
const myWorker = createWorker() Or with |
Why you bundle a Node.js Server-side-only application? |
It is part of an Electron backend. The MSI installer that Electron uses only copies files, it does not do an |
Here are some example of the new version: https://github.com/nextapps-de/flexsearch/tree/v0.8-preview?tab=readme-ov-file#example-nodejs |
I've setup a worker with
Everything word fine in development but then trying to run a production build (Nextjs with webpack) I get an error
`Error: Cannot find module '/Users/fredrik/dist/node/node.js'
This is most likely due to "../dist/node/node.js" not being part of the bundle.
Any ideas or workarounds for this?
The text was updated successfully, but these errors were encountered: