Skip to content

TypeError: Cannot read property 'Symbol(source-map-support/sharedData)' of undefined #43

Open

Description

@Wolftousen

We've got WDIO added to one of our projects and we are running into this error when we try to run npx wdio run wdio.conf.ts

2022-06-14T20:12:21.575Z ERROR @wdio/local-runner: Failed launching test session: Error: Couldn't initialise "@wdio/cucumber-framework".
TypeError: Cannot read property 'Symbol(source-map-support/sharedData)' of undefined
    at initializeSharedData (/Users/yexe017/Projects/OH/gcom-react-order-history/test/end-to-end/node_modules/@cucumber/cucumber/node_modules/@cspotcode/source-map-support/source-map-support.js:49:20)
    at Object.<anonymous> (/Users/yexe017/Projects/OH/gcom-react-order-history/test/end-to-end/node_modules/@cucumber/cucumber/node_modules/@cspotcode/source-map-support/source-map-support.js:78:18)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Module._compile (/Users/yexe017/Projects/OH/gcom-react-order-history/test/end-to-end/node_modules/pirates/lib/index.js:136:24)
    at Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at require.extensions.<computed> (/Users/yexe017/Projects/OH/gcom-react-order-history/test/end-to-end/node_modules/ts-node/src/index.ts:1445:43)
    at Object.newLoader [as .js] (/Users/yexe017/Projects/OH/gcom-react-order-history/test/end-to-end/node_modules/pirates/lib/index.js:141:7)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at safeRequire (/Users/yexe017/Projects/OH/gcom-react-order-history/test/end-to-end/node_modules/@wdio/utils/build/utils.js:192:15)
    at initialisePlugin (/Users/yexe017/Projects/OH/gcom-react-order-history/test/end-to-end/node_modules/@wdio/utils/build/initialisePlugin.js:30:50)
    at Runner.run (/Users/yexe017/Projects/OH/gcom-react-order-history/test/end-to-end/node_modules/@wdio/runner/build/index.js:82:56)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)

Was digging around to try to figure it out, is there a reason that this.hasOwnProperty(sharedDataKey) isn't checked before doing var sharedData = this[sharedDataKey]; in source-map-support.js to prevent this issue?

Activity

  1. alex-skiba-postnl commented on Jul 25, 2022

    @alex-skiba-postnl

    Hi, we're facing the same issue trying to run cucumber-js from the code (node). Are there any updates?

  2. m-i-wright commented on Aug 27, 2022

    @m-i-wright

    I ran into this issue in a small project while running my Jest tests (both the Jest configuration and the tests are written in TypeScript). I can confirm that the issue is fixed by the change suggested by @Wolftousen (pull request).

  3. aukevanleeuwen commented on Jan 27, 2023

    @aukevanleeuwen

    Same issue here as well, when trying to load source map support for a (CDK) NodejsFunction which has been bundled with esbuild.

  4. kenclive-wb commented on Feb 14, 2023

    @kenclive-wb

    Is there any chance of @Wolftousen's fix being bundled in a release? I am seeing this exact issue with latest v7 of @wdio/cucumber-framework on Windows 10, and I'm not sure how to fix this locally since it is a transitive dependency of @wdio/cucumber-framework. Interestingly, I am not seeing this on MacOS (running Monterey).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions