Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Exception when object field not included in fields list of find or findOne

Open
#34 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript, sqlite
Domain
database

Research direction

Start by reproducing the issue in the linked loopback-connector-sqlite3 sample with a model containing a number and object field, then trace the find and findOne entry points when only field1 is requested. Done means retrieving the record with fields: ['field1'] completes without the JSON parsing exception.

Written by the indexing model from the issue text.

Description

Bug or feature request
  • [X ] Bug
  • Feature request
Description of feature (or steps to reproduce if bug)
  1. Define a model with {field1: {type: 'number}, field2: {type: object'}}
  2. Create a model record
  3. Retrieve the model record with fields: ['field1']
Link to sample repo to reproduce issue (if bug)

https://github.com/aams/loopback-connector-sqlite3

Expected result

No crash

Actual result (if bug)

Exception "Uncaught SyntaxError: Unexpected token u in JSON at position 0"

Additional information (Node.js version, LoopBack version, etc)
Dominant language
JavaScript
Stars
13
Forks
21
PR merge metrics
No merged PRs in 30d

Getting set up

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.

More from loopbackio/loopback-connector-sqlite3

All issues in loopbackio/loopback-connector-sqlite3

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.