1

I am testing PouchDB app in IE8, but I am getting following errors. I have included pouchdb.localstorage.js and es5.shim.js file in index.html.

You can find below the errors:

  1. Expected Identifier, string or number for following line (pouchdb.localstorge.js):

Line no. 11019: , try: [

  1. Expected Identifier for following line (main.js - local js file):

}).catch(function (err) { console.log('Unable to insert into DB. Error: ' + err.name + ' - ' + err.message); });

How can I fix these issues?

sannitesh
  • 93
  • 1
  • 7
  • The PouchDB documentation says it supports Internet Explorer 10+. *edit* oh I see now that it *claims* that a shim should help ... – Pointy Apr 02 '15 at 13:25
  • Yes. So along with es5.shim.js, they suggested to include pouchdb.localstorage.js file which I did already. But still my app is not working in IE8 – sannitesh Apr 02 '15 at 13:28
  • Well that `, try: [` line is in the local storage add-on, and it's going to be treated as a syntax error by IE8 because `try` is a reserved word. I guess maybe you can log a bug? You could maybe patch your version of the file by putting `try` in double quotes, but other code may encounter similar errors with that property name. – Pointy Apr 02 '15 at 13:33
  • thanks for your response, Pointy. Actually I already tried that option (putting try in double quotes) but it didn't work :( – sannitesh Apr 02 '15 at 13:51

1 Answers1

1

This is a bug. Please file an issue on Github and we'll look into it. Seems the issue is that we need to es3ify the source file to escape keywords like "try."

nlawson
  • 11,510
  • 4
  • 40
  • 50
  • Thanks Nolan for the reply. The issue is filed on Github. https://github.com/pouchdb/pouchdb/issues/3688 – sannitesh Apr 03 '15 at 05:22