mbarchfe

mbarchfe

Vector Search with JavaScript: example is not working

If you came to this page via a book’s portal and it has pre-filled part of the title and tags for you please only add what you need to after the pre-filled text in the title, this is usually a description of what you are posting and the page number so it follows this format:

Title: Vector Search with JavaScript
I have cloned the git repo from GitHub - hummusonrails/vector-example-blog-platform: Fully featured Medium.com clone with vector search functionality.

Unfortunately, I can not start it (on main branch):

> npm install; npm run dev
...
/Users/markus/git/vector-example-blog-platform/models/User.js:57
userModel.methods.generateAccessToken = function() {
                                      ^

TypeError: Cannot set properties of undefined (setting 'generateAccessToken')
    at Object.<anonymous> (/Users/markus/git/vector-example-blog-platform/models/User.js:57:39)
    at Module._compile (node:internal/modules/cjs/loader:1469:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)
    at Module.load (node:internal/modules/cjs/loader:1288:32)
    at Module._load (node:internal/modules/cjs/loader:1104:12)
    at Module.require (node:internal/modules/cjs/loader:1311:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (/Users/markus/git/vector-example-blog-platform/config/dbConnect.js:2:28)
    at Module._compile (node:internal/modules/cjs/loader:1469:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)

Node.js v20.17.0
[nodemon] app crashed - waiting for file changes before starting...

Also: what version of Couchbase should I install? Is the community edition sufficient?

Thanks
Markus

First Post!

hummusonrails

hummusonrails

Author of Vector Search with JavaScript

Hi Markus,

Thank you for flagging this issue! The error you encountered was due to an incorrect usage of the Ottoman schema API, but it has now been fixed in the GitHub repo, and the fix will be applied in the book as well. Your comment is very much appreciated.

To run the project and use the vectorization features, you’ll need to use Couchbase Capella (the fully managed cloud service from Couchbase), which offers a free tier and includes the vector search capabilities required by this project. The Community Edition does not support the vectorization service.

Please sign up for a free Capella account and use your connection string in the project’s configuration as shown in the .env.example file in the root folder of the GitHub repo. The book outlines the steps to connect your Capella account to your local project in detail.

All the best,

Ben

Where Next?

Popular Pragmatic Bookshelf topics Top

johnp
Running the examples in chapter 5 c under pytest 5.4.1 causes an AttributeError: ‘module’ object has no attribute ‘config’. In particula...
New
GilWright
Working through the steps (checking that the Info,plist matches exactly), run the demo game and what appears is grey but does not fill th...
New
jdufour
Hello! On page xix of the preface, it says there is a community forum "… for help if your’re stuck on one of the exercises in this book… ...
New
raul
Page 28: It implements io.ReaderAt on the store type. Sorry if it’s a dumb question but was the io.ReaderAt supposed to be io.ReadAt? ...
New
HarryDeveloper
Hi @venkats, It has been mentioned in the description of ‘Supervisory Job’ title that 2 things as mentioned below result in the same eff...
New
jskubick
I’m under the impression that when the reader gets to page 136 (“View Data with the Database Inspector”), the code SHOULD be able to buil...
New
New
oaklandgit
Hi, I completed chapter 6 but am getting the following error when running: thread 'main' panicked at 'Failed to load texture: IoError(O...
New
adamwoolhether
Is there any place where we can discuss the solutions to some of the exercises? I can figure most of them out, but am having trouble with...
New
akraut
The markup used to display the uploaded image results in a Phoenix.LiveView.HTMLTokenizer.ParseError error. lib/pento_web/live/product_l...
New

Other popular topics Top

AstonJ
A thread that every forum needs! Simply post a link to a track on YouTube (or SoundCloud or Vimeo amongst others!) on a separate line an...
New
AstonJ
What chair do you have while working… and why? Is there a ‘best’ type of chair or working position for developers?
New
dasdom
No chair. I have a standing desk. This post was split into a dedicated thread from our thread about chairs :slight_smile:
New
PragmaticBookshelf
“Finding the Boundaries” Hero’s Journey with Noel Rappin @noelrappin Even when you’re ultimately right about what the future ho...
New
AstonJ
Seems like a lot of people caught it - just wondered whether any of you did? As far as I know I didn’t, but it wouldn’t surprise me if I...
New
Help
I am trying to crate a game for the Nintendo switch, I wanted to use Java as I am comfortable with that programming language. Can you use...
New
PragmaticBookshelf
Author Spotlight Mike Riley @mriley This month, we turn the spotlight on Mike Riley, author of Portable Python Projects. Mike’s book ...
New
DevotionGeo
I have always used antique keyboards like Cherry MX 1800 or Cherry MX 8100 and almost always have modified the switches in some way, like...
New
hilfordjames
There appears to have been an update that has changed the terminology for what has previously been known as the Taskbar Overflow - this h...
New
New

Sub Categories: