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

build/doc: remind user to run Docker, regenerate broken package-lock.json, and upgrade incompatible supabase-js lib #3

Closed
wants to merge 2 commits into from

Conversation

itsuka-dev
Copy link

@itsuka-dev itsuka-dev commented Nov 1, 2023

First off, thank you very much for kicking off this project! I'm just getting started building my own local stack on the web platform, so it's great to have more references available.


I bumped into a few issues while setting up this project, so I figured I'd share them here.

Problem

My Docker was not running when executing supabase start:

Cannot connect to the Docker daemon at unix:///Users/itsuka/.docker/run/docker.sock. Is the docker daemon running?

Solution

I updated the readme to remind users to (install and) run Docker if not running already.

Problem

I ran into the following error when executing node src/scripts/indexBlogLocal.mjs:

/local-ai-stack/node_modules/sharp/lib/sharp.js:37
  throw new Error(help.join('\n'));
        ^

Error:
Something went wrong installing the "sharp" module

Cannot find module '../build/Release/sharp-darwin-arm64v8.node'
Require stack:
- /local-ai-stack/node_modules/sharp/lib/sharp.js
...

Possible solutions:
- Install with verbose logging and look for errors: "npm install --ignore-scripts=false --foreground-scripts --verbose sharp"
- Install for the current darwin-arm64v8 runtime: "npm install --platform=darwin --arch=arm64v8 sharp"

I'm no expert when it comes to the JS build system. All I understand is that npm install script should create a build output at node_modules/sharp/build/Release/. But for some reason, it's not happening in my case. Note: the "possible solutions" suggested above do nothing for me.

While I was browsing through the issues on Sharp's repository, I came across this issue where someone hinted at the possibility of NPM lockfile bug.

Solution

I simply regenerate package-lock.json file by running npm install, and now I can see that the sharp/build/Release directory has been created.

Problem

During a chat with the local model, I was getting no response. Instead, I got this error:

Module not found: Can't resolve 'encoding' in '/local-ai-stack/node_modules/node-fetch/lib'

Import trace for requested module:
./node_modules/node-fetch/lib/index.js
./node_modules/openai/_shims/node-runtime.js
./node_modules/openai/_shims/auto/runtime-node.js
./node_modules/openai/_shims/index.js
./node_modules/openai/core.js
./node_modules/openai/index.js
./node_modules/langchain/dist/embeddings/openai.js
./node_modules/langchain/embeddings/openai.js
./src/app/api/qa-pg-vector/route.ts

Solution

Installing encoding would solve this problem, but this issue has already been resolved in a later version of supabase-js. So I just upgraded that library to the latest version.

@itsuka-dev itsuka-dev changed the title build/doc: remind user to run Docker and regenerate broken package-lock.json build/doc: remind user to run Docker, regenerate broken package-lock.json, and upgrade incompatible supabase-js lib Nov 1, 2023
@ykhli
Copy link
Owner

ykhli commented Nov 1, 2023

this is amazing @itsuka-dev! Will review tonight 🙏

@itsuka-dev itsuka-dev closed this Nov 9, 2023
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

Successfully merging this pull request may close these issues.

2 participants