0

I am trying to run cypress E2E test case(written in typescript) on BrowserStack.

Library details:-

"typescript": "~4.2.4",
"cypress": "9.5.0",
"browserstack-cypress-cli": "1.14.0"

I have provided all details of browserstack.json according to documentation. But I got error

Running:  info.spec.ts                                                          (NaN of undefined)

Oops...we found an error preparing this test file:

  > src\integration\TEST\info.spec.ts

The error was:

Error: Webpack Compilation Error
./src/integration/TEST/info.spec.ts
Module build failed (from C:/Windows/cypress_package/9.5.4/node_modules/@cypress/webpack-batteries-included-preprocessor/node_modules/ts-loader/index.js):
Error: error while parsing tsconfig.json
    at handle (C:\Windows\cypress_package\9.5.4\node_modules\@cypress\webpack-preprocessor\dist\index.js:180:23)
    at finalCallback (C:\Windows\cypress_package\9.5.4\node_modules\webpack\lib\Compiler.js:257:39)
    at C:\Windows\cypress_package\9.5.4\node_modules\webpack\lib\Compiler.js:306:14
    at AsyncSeriesHook.eval [as callAsync] (eval at create (C:\Windows\cypress_package\9.5.4\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:4:1)
    at AsyncSeriesHook.lazyCompileHook (C:\Windows\cypress_package\9.5.4\node_modules\tapable\lib\Hook.js:154:20)
    at C:\Windows\cypress_package\9.5.4\node_modules\webpack\lib\Compiler.js:304:22
    at Compiler.emitRecords (C:\Windows\cypress_package\9.5.4\node_modules\webpack\lib\Compiler.js:499:39)
    at C:\Windows\cypress_package\9.5.4\node_modules\webpack\lib\Compiler.js:298:10
    at C:\Windows\cypress_package\9.5.4\node_modules\webpack\lib\Compiler.js:485:14
    at AsyncSeriesHook.eval [as callAsync] (eval at create (C:\Windows\cypress_package\9.5.4\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:4:1)
    at AsyncSeriesHook.lazyCompileHook (C:\Windows\cypress_package\9.5.4\node_modules\tapable\lib\Hook.js:154:20)
    at C:\Windows\cypress_package\9.5.4\node_modules\webpack\lib\Compiler.js:482:27
    at C:\Windows\cypress_package\9.5.4\node_modules\neo-async\async.js:2818:7
    at done (C:\Windows\cypress_package\9.5.4\node_modules\neo-async\async.js:3522:9)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (C:\Windows\cypress_package\9.5.4\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:4:1)
    at AsyncSeriesHook.lazyCompileHook (C:\Windows\cypress_package\9.5.4\node_modules\tapable\lib\Hook.js:154:20)
    at C:\Windows\cypress_package\9.5.4\node_modules\webpack\lib\Compiler.js:464:33
    at C:\Windows\cypress_package\9.5.4\node_modules\graceful-fs\graceful-fs.js:143:16
    at C:\Windows\cypress_package\9.5.4\node_modules\graceful-fs\graceful-fs.js:61:14
    at FSReqCallback.oncomplete (fs.js:156:23)
7
  • Perhaps something is wrong with your tsconfig.json? Commented May 5, 2022 at 22:45
  • It's running fine on my local system. Commented May 6, 2022 at 10:07
  • @DheerajkumarRao did you figure this out? I'm running into the same problem Commented Jun 1, 2022 at 21:15
  • @Gisheri Please check tsconfig file. Issue was with tsconfig file. Commented Jun 2, 2022 at 10:07
  • Thanks. It's interesting, If I try to extend a tsconfig base, it throws this error, but if I copy the base config and don't use the extend, then it's fine. Commented Jun 3, 2022 at 16:10

1 Answer 1

0

You can check if you have added the base URL in tsconfig.json

Also, do try running it on your local machine once without BrowserStack

Sign up to request clarification or add additional context in comments.

2 Comments

It's running fine on my local system.
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.