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

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

Open
Wolftousen opened this issue Jun 14, 2022 · 4 comments

Comments

@Wolftousen
Copy link

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?

@alex-skiba-postnl
Copy link

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

@fluffy-heinzelman
Copy link

fluffy-heinzelman commented Aug 27, 2022

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).

@aukevanleeuwen
Copy link

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

@kenclive-wb
Copy link

kenclive-wb commented Feb 14, 2023

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants