louislam / louislam/redbean-node

TypeError: 'set' on proxy: trap returned falsish for property

Open
#2 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
33
Forks
10
PR merge metrics
No merged PRs in 30d

Description

Hello, I am trying to create a simple relation but I am getting this very uninformative error.

This is the code:

```
let car = db.R.dispense('car');
car.brand = 'Brand';
car.model = 'Model';
car.year = 'Model';
car.chat_keyword= 'KWD';
try {await db.R.store(car);}catch (e) {console.log(e);}

console.log("Creating usercar model");
let usercar = db.R.dispense('usercar');
usercar.added_date = db.R.isoDate();
usercar.car = car;
try {await db.R.store(usercar);}catch (e) {console.log(e);}
```

Error:

```
TypeError: 'set' on proxy: trap returned falsish for property 'carId'
at Proxy. (C:\Users\Perroloco\Programming\node\evsyscheduler\node_modules\redbean-node\dist\bean.js:187:57)
at Generator.next ()
at C:\Users\Perroloco\Programming\node\evsyscheduler\node_modules\redbean-node\dist\bean.js:14:71
at new Promise ()
at __awaiter (C:\Users\Perroloco\Programming\node\evsyscheduler\node_modules\redbean-node\dist\bean.js:10:12)
at Proxy.storeTypeBeanList (C:\Users\Perroloco\Programming\node\evsyscheduler\node_modules\redbean-node\dist\bean.js:180:16)
at RedBeanNode. (C:\Users\Perroloco\Programming\node\evsyscheduler\node_modules\redbean-node\dist\redbean-node.js:126:24)
at Generator.next ()
at C:\Users\Perroloco\Programming\node\evsyscheduler\node_modules\redbean-node\dist\redbean-node.js:8:71
at new Promise ()
at __awaiter (C:\Users\Perroloco\Programming\node\evsyscheduler\node_modules\redbean-node\dist\redbean-node.js:4:12)
at RedBeanNode.storeCore (C:\Users\Perroloco\Programming\node\evsyscheduler\node_modules\redbean-node\dist\redbean-node.js:124:16)
at RedBeanNode. (C:\Users\Perroloco\Programming\node\evsyscheduler\node_modules\redbean-node\dist\redbean-node.js:116:35)
at Generator.next ()
at fulfilled (C:\Users\Perroloco\Programming\node\evsyscheduler\node_modules\redbean-node\dist\redbean-node.js:5:58)
```

Am I doing something wrong? thx

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the stack-trace locations in dist/bean.js around line 180 and redbean-node.js around lines 124-126, then reproduce the car/usercar relation example. Determine whether the reported proxy assignment is expected behavior or an error, and document the result or a focused fix with coverage for this relation case.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
backend, database
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.