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

Getting import error while using with wdio TS project with module ESNext #17

Open
sundarlogan opened this issue Apr 11, 2024 · 0 comments

Comments

@sundarlogan
Copy link

Getting below error:

`import AzureDevopsService from './azure-devops-service';
^^^^^^

SyntaxError: Cannot use import statement outside a module
at internalCompileFunction (node:internal/vm:77:18)
at wrapSafe (node:internal/modules/cjs/loader:1288:20)
at Module._compile (node:internal/modules/cjs/loader:1340:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
at Object.require.extensions. [as .js] (C:\Users\SundaravelLoganathan\Documents\saim_codes\web-revedia\test\node_modules\ts-node\src\index.ts:1608:43)
at Module.load (node:internal/modules/cjs/loader:1207:32)
at Function.Module._load (node:internal/modules/cjs/loader:1023:12)
at cjsLoader (node:internal/modules/esm/translators:356:17)
at ModuleWrap. (node:internal/modules/esm/translators:305:7)
at ModuleJob.run (node:internal/modules/esm/module_job:218:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
at async ConfigParser.addConfigFile (file:///C:/Users/SundaravelLoganathan/Documents/saim_codes/web-revedia/test/node_modules/@wdio/config/build/node/ConfigParser.js:94:36)
at async ConfigParser.initialize (file:///C:/Users/SundaravelLoganathan/Documents/saim_codes/web-revedia/test/node_modules/@wdio/config/build/node/ConfigParser.js:56:13)
at async Launcher.run (file:///C:/Users/SundaravelLoganathan/Documents/saim_codes/web-revedia/test/node_modules/@wdio/cli/build/launcher.js:41:9)
at async Module.run (file:///C:/Users/SundaravelLoganathan/Documents/saim_codes/web-revedia/test/node_modules/@wdio/cli/build/run.js:64:20)`

Attached tsconfig.json file
tsconfig.json

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

1 participant