Skip to content
This repository was archived by the owner on Aug 25, 2024. It is now read-only.
This repository was archived by the owner on Aug 25, 2024. It is now read-only.

Undefined method `[]' for nil:NilClass. Server reachs an empty array #31

@burakakca

Description

@burakakca

I'm using the example of todo for client, for server ruby_rack test example. When i send todo data from client, server getting this error;

index.js:26 Logux user ID was changed to 1
index.js:36 Logux state is connecting
index.js:36 Logux tab role is leader
index.js:26 Logux state is synchronized
index.js:26 Logux added tasks/create action
index.js:36 Logux state is sending
react_devtools_backend.js:4026 Error on Logux server:
 undefined method `[]' for nil:NilClass
/home/burak/Desktop/logux/logux-rack/test/app/app/logux/actions/tasks.rb:11:in `create'
/home/burak/Desktop/logux/logux-rack/lib/logux/action_caller.rb:27:in `public_send'
/home/burak/Desktop/logux/logux-rack/lib/logux/action_caller.rb:27:in `call_action'
/home/burak/Desktop/logux/logux-rack/lib/logux/action_caller.rb:18:in `block in call!'
/home/burak/Desktop/logux/logux-rack/lib/logux/action_watcher.rb:17:in `call'
/home/burak/Desktop/logux/logux-rack/lib/logux/rack.rb:110:in `watch_action'
/home/burak/Desktop/logux/logux-rack/lib/logux/action_caller.rb:18:in `call!'
/home/burak/Desktop/logux/logux-rack/lib/logux/process/action.rb:51:in `process_action!'
/home/burak/Desktop/logux/logux-rack/lib/logux/process/action.rb:17:in `call'
/home/burak/Desktop/logux/logux-rack/lib/logux/process/batch.rb:44:in `process_action'
/home/burak/Desktop/logux/logux-rack/lib/logux/process/batch.rb:27:in `process'
/home/burak/Desktop/logux/logux-rack/lib/logux/process/batch.rb:17:in `block in call'
/home/burak/Desktop/logux/logux-rack/lib/logux/process/batch.rb:16:in `map'
/home/burak/Desktop/logux/logux-rack/lib/logux/process/batch.rb:16:in `with_index'
/home/burak/Desktop/logux/logux-rack/lib/logux/process/batch.rb:16:in `call'
/home/burak/Desktop/logux/logux-rack/lib/logux/rack.rb:94:in `process_batch'
/home/burak/Desktop/logux/logux-rack/lib/logux/rack/app.rb:58:in `build_response'
/home/burak/Desktop/logux/logux-rack/lib/logux/rack/app.rb:21:in `block (2 levels) in process'
/home/burak/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/puma-5.6.5/lib/puma/request.rb:144:in `handle_request'
/home/burak/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/puma-5.6.5/lib/puma/server.rb:443:in `process_client'
/home/burak/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/puma-5.6.5/lib/puma/thread_pool.rb:147:in `block in spawn_thread'
overrideMethod @ react_devtools_backend.js:4026
(anonymous) @ index.js:280
emit @ index.js:6
debugMessage @ index.js:6
onMessage @ index.js:199
(anonymous) @ index.js:93
emit @ index.js:6
ws.onmessage @ index.js:35
index.js:36 Logux state is synchronized
index.js:26 Logux cleaned tasks/create action
index.js:26 Logux action tasks/create was undone because of error
index.js:182 Uncaught (in promise) LoguxUndoError: Server undid tasks/create because of error
    at Array.<anonymous> (index.js:182:41)
    at Object.emit (index.js:6:17)
    at actionEvents (index.js:8:11)
    at Array.<anonymous> (index.js:152:7)
    at Object.emit (index.js:6:17)
    at actionEvents (index.js:8:11)
    at Log.add (index.js:104:9)
(anonymous) @ index.js:182
emit @ index.js:6
actionEvents @ index.js:8
(anonymous) @ index.js:152
emit @ index.js:6
actionEvents @ index.js:8
add @ index.js:104

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions