Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7670707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T15:53:03+00:00 2026-05-31T15:53:03+00:00

I am trying to set up indexeddb storage for use in chrome. But am

  • 0

I am trying to set up indexeddb storage for use in chrome. But am getting an Uncaught TypeError when I try to set up a READ_WRITE transaction.

I have not been able to find good, up to date info on using webkitIDB. So I’m basically flying blind here. Any ideas what I’ve done wrong? Are there good tuts out there on this that I missed?

Setup:

function OfflineStorage() {
  this.saveJSONString = __bind(this.saveJSONString, this);
  var request,
    _this = this;
  this.dbkeyRange = window.webkitIDBKeyRange;
  this.dbTransaction = window.webkitIDBTransaction;
  this.db = window.webkitIndexedDB;
  request = this.db.open("lucidFrog");
  request.onsuccess = function(e) {
    _this.db = e.target.result;
    return _this.setupDB(); //setupDB() ensures the objectStores have been created.
  };
}    

Save Function:

OfflineStorage.prototype.saveJSONString = function(objectStore, json_string, obj_id) {
  var request, store, transaction;

  //PROBLEM AREA, gives "Uncaught TypeError: Type error"
  transaction = this.db.transaction([objectStore], this.dbTransaction.READ_WRITE, 0);
  ////////////////////

  store = transaction.objectStore(objectStore);
  request = store.put({
    "json": json_string,
    "id": obj_id
  });
  request.onsuccess = function(e) {
    return console.log("YYYYYYEEEEEAAAAAHHHHHH!!!");
  };
};

The requested objectStore has been created, and confirmed that this.dbTransaction is defined.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T15:53:04+00:00Added an answer on May 31, 2026 at 3:53 pm

    This is not an IndexedDB error thrown from the object store, but something in the setup. This kind of error is thrown when you pass the wrong object type to an invocation, which is why my first guess was that the objectStore var was not actually a string.

    Based on elimination this.db is not undefined (else it would error on transaction), transaction is a function (else it would throw non-function invocation). So I have to guess that this.dbTransaction.READ_WRITE should be returning 1 just fine (double check this).

    Therefore, I strongly suspect this is your 3rd parameter causing issues. I am fairly certain I have never used the 3rd param shown in spec (optional timeout) and believe it’s unnecessary here since the default timeout is already 0 (indefinite). Can you try to change that line to the following and see if it works?

    transaction = this.db.transaction([objectStore], this.dbTransaction.READ_WRITE);

    UPDATE: Note that the version constants are now deprecated. Instead of those numeric values, you need to pass a string now: “readwrite”, “readonly” or “versionchange”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to set a flag in the post to allow processing or not. The
When trying to set DoMatchParen I get the following error: E492: Not an editor
Im trying to build a kd-tree for searching through a set of points, but
I'm trying to use Boost's multi-index container for fast look up, but I'm having
I am using latest google chrome..I am trying to implement HTML5 indexedDB example. AIM
Trying to set up a model observer. AuditTrail is triggered however it's not passing
I have Chromium 12.0.742.112 (90304) and I'm trying to set up a simple WebSocket
I'm trying to get a MultiValueField to be indexed, but it's just not working.
So I'm trying to write a MasterMind game, but I have a problem I
I'm trying to use a std::set where I will throw a bunch of edges

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.