Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sheet connect() not work as expected #8

Open
huan opened this issue Dec 30, 2019 · 1 comment
Open

Sheet connect() not work as expected #8

huan opened this issue Dec 30, 2019 · 1 comment
Assignees

Comments

@huan
Copy link

huan commented Dec 30, 2019

My google spreadsheet is public read & write able.

My code t.js is as the following:

const connect = require('sheet-db')

// https://docs.google.com/spreadsheets/d/106lfsqgEOMqRX3apK3qGbVcjQIaCK7EudHHI3-TpEKQ/edit?usp=sharing
const sheet = connect('106lfsqgEOMqRX3apK3qGbVcjQIaCK7EudHHI3-TpEKQ')

sheet
  .info().then(console.info)
  .catch(console.error)

It show the following error message when I run it:

$ node t.js
Error: The response contains invalid data
    at _callee$ (/home/huan/git/mike-bo/node_modules/sheet-db/lib/rest_client.js:44:31)
    at tryCatch (/home/huan/git/mike-bo/node_modules/regenerator-runtime/runtime.js:65:40)
    at Generator.invoke [as _invoke] (/home/huan/git/mike-bo/node_modules/regenerator-runtime/runtime.js:303:22)
    at Generator.prototype.(anonymous function) [as next] (/home/huan/git/mike-bo/node_modules/regenerator-runtime/runtime.js:117:21)
    at step (/home/huan/git/mike-bo/node_modules/sheet-db/lib/rest_client.js:588:191)
    at /home/huan/git/mike-bo/node_modules/sheet-db/lib/rest_client.js:588:361
    at process._tickCallback (internal/process/next_tick.js:68:7)
@tadam313
Copy link
Owner

tadam313 commented Feb 8, 2020

Valid point, I need to update the Readme. Thing is you still need an access token even you are trying to read a public spreadsheet, so there is no "tokenless" scenario. I'll update a readme and add a check to throw more meaningful error.

@tadam313 tadam313 self-assigned this Feb 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants