Skip to content

Traceback when attempting to import redux-saga-test-plan in a test #2410

@jonathanj

Description

@jonathanj

🐛 bug report

Description of the problem

Trying to import redux-saga-test-plan in a test file fails (at the point of import) with the (chunky) traceback below.

If I try install this locally I get a warning:

npm WARN deprecated json3@3.3.0: Please use the native JSON object instead of JSON 3

Which seems related to the top of the traceback. The line in question in json3 is this:

    var objectProto = Object.prototype,

I don't have any issues running this in a local node environment though.

Traceback

Cannot read property 'prototype' of undefined

TypeError: Cannot read property 'prototype' of undefined
    at runInContext (https://737lq.csb.app/node_modules/json3/lib/json3.js:38:30)
    at eval (https://737lq.csb.app/node_modules/json3/lib/json3.js:872:5)
    at evaluate (https://737lq.csb.app/node_modules/json3/lib/json3.js:897:2)
    at $n (https://codesandbox.io/static/js/sandbox.3300dc61.js:1:148676)
    at e.value (https://codesandbox.io/static/js/sandbox.3300dc61.js:1:163940)
    at e.value (https://codesandbox.io/static/js/sandbox.3300dc61.js:1:203124)
    at t (https://codesandbox.io/static/js/sandbox.3300dc61.js:1:163682)
    at evaluate (https://737lq.csb.app/node_modules/util-inspect/index.js:12:12)
    at $n (https://codesandbox.io/static/js/sandbox.3300dc61.js:1:148676)
    at e.value (https://codesandbox.io/static/js/sandbox.3300dc61.js:1:163940)
    at e.value (https://codesandbox.io/static/js/sandbox.3300dc61.js:1:203124)
    at t (https://codesandbox.io/static/js/sandbox.3300dc61.js:1:163682)
    at evaluate (https://737lq.csb.app/node_modules/redux-saga-test-plan/lib/shared/serializeEffect.js:9:20)
    at $n (https://codesandbox.io/static/js/sandbox.3300dc61.js:1:148676)
    at e.value (https://codesandbox.io/static/js/sandbox.3300dc61.js:1:163940)
    at e.value (https://codesandbox.io/static/js/sandbox.3300dc61.js:1:203124)
    at t (https://codesandbox.io/static/js/sandbox.3300dc61.js:1:163682)
    at evaluate (https://737lq.csb.app/node_modules/redux-saga-test-plan/lib/testSaga/createErrorMessage.js:6:24)
    at $n (https://codesandbox.io/static/js/sandbox.3300dc61.js:1:148676)
    at e.value (https://codesandbox.io/static/js/sandbox.3300dc61.js:1:163940)
    at e.value (https://codesandbox.io/static/js/sandbox.3300dc61.js:1:203124)
    at t (https://codesandbox.io/static/js/sandbox.3300dc61.js:1:163682)
    at evaluate (https://737lq.csb.app/node_modules/redux-saga-test-plan/lib/testSaga/index.js:28:27)
    at $n (https://codesandbox.io/static/js/sandbox.3300dc61.js:1:148676)
    at e.value (https://codesandbox.io/static/js/sandbox.3300dc61.js:1:163940)
    at e.value (https://codesandbox.io/static/js/sandbox.3300dc61.js:1:203124)
    at t (https://codesandbox.io/static/js/sandbox.3300dc61.js:1:163682)
    at evaluate (https://737lq.csb.app/node_modules/redux-saga-test-plan/lib/index.js:6:18)
    at $n (https://codesandbox.io/static/js/sandbox.3300dc61.js:1:148676)
    at e.value (https://codesandbox.io/static/js/sandbox.3300dc61.js:1:163940)
    at e.value (https://codesandbox.io/static/js/sandbox.3300dc61.js:1:203124)
    at t (https://codesandbox.io/static/js/sandbox.3300dc61.js:1:163682)
    at evaluate (https://737lq.csb.app/src/index.test.js:3:1)
    at $n (https://codesandbox.io/static/js/sandbox.3300dc61.js:1:148676)
    at e.value (https://codesandbox.io/static/js/sandbox.3300dc61.js:1:163940)
    at e.value (https://codesandbox.io/static/js/sandbox.3300dc61.js:1:203124)
    at e.value (https://codesandbox.io/static/js/sandbox.3300dc61.js:1:202703)
    at https://codesandbox.io/static/js/sandbox.3300dc61.js:1:191828
    at a (https://codesandbox.io/static/js/common-sandbox.f352477c.chunk.js:1:14585)
    at Generator._invoke (https://codesandbox.io/static/js/common-sandbox.f352477c.chunk.js:1:14373)
    at Generator.e.<computed> [as next] (https://codesandbox.io/static/js/common-sandbox.f352477c.chunk.js:1:15007)
    at t (https://codesandbox.io/static/js/common-sandbox.f352477c.chunk.js:1:8537)
    at u (https://codesandbox.io/static/js/common-sandbox.f352477c.chunk.js:1:8747)
    at https://codesandbox.io/static/js/common-sandbox.f352477c.chunk.js:1:8806
    at new Promise (<anonymous>)
    at https://codesandbox.io/static/js/common-sandbox.f352477c.chunk.js:1:8688
    at https://codesandbox.io/static/js/sandbox.3300dc61.js:1:192173
    at Array.map (<anonymous>)
    at e.<anonymous> (https://codesandbox.io/static/js/sandbox.3300dc61.js:1:191546)
    at a (https://codesandbox.io/static/js/common-sandbox.f352477c.chunk.js:1:14585)

How has this issue affected you? What are you trying to accomplish?

I'm trying to write (demonstrative) Redux Saga tests for my sandbox and this issue is preventing me from doing so.

Link to sandbox: Sandbox exhibiting the issue

Your Environment

Software Name/Version
Сodesandbox PROD-1568034248-9733ef7ef
Browser Chrome 78.0.3887.7 (Official Build) dev (64-bit)
Operating System macOS 10.14.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions