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

Cannot use 'in' operator to search for 'settings' in null #8

Closed
jack-guy opened this issue Mar 27, 2016 · 1 comment
Closed

Cannot use 'in' operator to search for 'settings' in null #8

jack-guy opened this issue Mar 27, 2016 · 1 comment

Comments

@jack-guy
Copy link

@jack-guy jack-guy commented Mar 27, 2016

I get this whenever I call .get on one of my services that's supposed to be localstorage.

My app

    let app = feathers()
      .configure(hooks())
      .configure(socketio(this.socket))
      .configure(authentication({ storage: window.localStorage }))
      .use('storage', localstorage({ storage: window.localStorage}))

And when I call

    app.service('storage').get('settings').then((settings) => foo(settings));

I get the error (which I could have caught)

TypeError: Cannot use 'in' operator to search for 'settings' in null

The first line in the stack points to my main.bundle.js (I'm using Webpack)

      {
        key: 'get',
        value: function get(id) {
          if (id in this.store) {
            return Promise.resolve(this.store[id]);
          }

          return Promise.reject(new _feathersErrors2.default.NotFound('No record found for id \'' + id + '\''));
        }
      }

So clearly this.store is null. Didn't trace much further than that.

@jack-guy

This comment has been minimized.

Copy link
Author

@jack-guy jack-guy commented Mar 27, 2016

Fixed #9

@jack-guy jack-guy closed this Mar 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.