fergiemcdowall / search-index

A persistent, network resilient, full text search library for the browser and Node.js
MIT License
1.39k stars 149 forks source link

No native build was found for platform=linux arch=x64 runtime=node abi=83 uv=1 libc=glibc #552

Closed tonprince closed 3 years ago

tonprince commented 3 years ago

I am trying to use the search-index library with Sveltekit on Vercel.

After deployment on Vercel, I always got the error shown below. In my dev env everything is fine. It seams that Vercel cannot find glibc on the Linux machine. Do you have any idea to solve that issue?

2021-07-10T10:17:16.292Z 2a5cb377-9a23-45d5-9991-fae6752b7873 ERROR Error: No native build was found for platform=linux arch=x64 runtime=node abi=83 uv=1 libc=glibc at Function.load2.path (/var/task/index.js:254687:13) at load2 (/var/task/index.js:254654:35) at node_modules/fergies-inverted-index/node_modules/leveldown/binding.js (/var/task/index.js:254783:47) at __require (/var/task/index.js:12:44) at node_modules/fergies-inverted-index/node_modules/leveldown/leveldown.js (/var/task/index.js:254868:19) at __require (/var/task/index.js:12:44) at node_modules/fergies-inverted-index/node_modules/level/level.js (/var/task/index.js:254988:48) at __require (/var/task/index.js:12:44) at node_modules/fergies-inverted-index/src/main.js (/var/task/index.js:255636:17) at __require (/var/task/index.js:12:44)RequestId: 2a5cb377-9a23-45d5-9991-fae6752b7873 Error: Runtime exited with error: exit status 1Runtime.ExitError

fergiemcdowall commented 3 years ago

I dont have a great deal of experience with Vercel, but if anybody else does, tips for the FAQ would be greatly appreciated.

tonprince commented 3 years ago

I extracted the search-index logic into a Vercel serverless function and also included the index files via includeFiles property. But there is now another issue when reading/writing the lock file as it seams Vercel does only provide a read-only file system.

2021-07-10T20:02:14.819Z 2feb6694-6bb9-4e44-94bc-cb889ccedd9d ERROR Unhandled Promise Rejection {"errorType":"Runtime.UnhandledPromiseRejection","errorMessage":"OpenError: IO error: PRODUCT/LOCK: Read-only file system","reason":{"errorType":"OpenError","errorMessage":"IO error: PRODUCT/LOCK: Read-only file system","stack":["OpenError: IO error: PRODUCT/LOCK: Read-only file system"," at /var/task/api/node_modules/levelup/lib/levelup.js:119:23"," at /var/task/api/node_modules/abstract-leveldown/abstract-leveldown.js:38:14"," at /var/task/api/node_modules/deferred-leveldown/deferred-leveldown.js:31:21"," at /var/task/api/node_modules/encoding-down/node_modules/abstract-leveldown/abstract-leveldown.js:38:14"," at /var/task/api/node_modules/abstract-leveldown/abstract-leveldown.js:38:14"]},"promise":{},"stack":["Runtime.UnhandledPromiseRejection: OpenError: IO error: PRODUCT/LOCK: Read-only file system"," at process.<anonymous> (/var/runtime/index.js:35:15)"," at process.emit (events.js:388:22)"," at processPromiseRejections (internal/process/promises.js:245:33)"," at processTicksAndRejections (internal/process/task_queues.js:96:32)"]}Unknown application error occurred

tonprince commented 3 years ago

Finally I copied the index files to /tmp folder which is writable but limited to 500 MB on Vercel. For my use case perfectly fine as it is anyway readonly and index will be build with project build.

fergiemcdowall commented 3 years ago

Glad you worked it out @tonprince - thanks for leaving the update.