
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
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
Popular Pragmatic Bookshelf topics










Other popular topics










Categories:
Sub Categories:
Popular Portals
- /elixir
- /rust
- /wasm
- /ruby
- /erlang
- /phoenix
- /keyboards
- /rails
- /js
- /python
- /security
- /go
- /swift
- /vim
- /clojure
- /emacs
- /haskell
- /java
- /onivim
- /svelte
- /typescript
- /crystal
- /kotlin
- /c-plus-plus
- /tailwind
- /gleam
- /ocaml
- /react
- /elm
- /flutter
- /vscode
- /ash
- /opensuse
- /centos
- /html
- /php
- /deepseek
- /zig
- /scala
- /lisp
- /textmate
- /sublime-text
- /nixos
- /debian
- /react-native
- /agda
- /kubuntu
- /arch-linux
- /ubuntu
- /revery
- /django
- /spring
- /manjaro
- /nodejs
- /diversity
- /lua
- /julia
- /slackware
- /c
- /markdown