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

Module build failed : Unexpected token, expected "," #48

Open
Vignesh-527 opened this issue Mar 18, 2024 · 0 comments
Open

Module build failed : Unexpected token, expected "," #48

Vignesh-527 opened this issue Mar 18, 2024 · 0 comments

Comments

@Vignesh-527
Copy link

Vignesh-527 commented Mar 18, 2024

I am new to k6 and have been using it to test a react web application written in typescript. So I am using this template to compile the typescript component to javascript. I cloned the template to the existing project folder and created a .ts file and scripted the test script in it. It calls to other components in the project folder that is in typescript. So when I imported them in the current test script and I run the "npm run bundle" I am repeatedly getting the same error in 4 different components

ERROR in ../src/e2e/helpers/resetLocalStorage.ts
Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: C:\Users\vignesh.t\SkillfitFrontend\src\e2e\helpers\resetLocalStorage.ts: Unexpected token, expected "," (6:47)

 4 | import { HTTPRequest } from 'puppeteer';
 5 |
> 6 | export const resetLocalStorage = async (browser: BrowserContext, url: string): Promise<void> => {
   |                                                                                 ^
 7 |   const page = await browser.newPage();
 8 |   await page.setRequestInterception(true);
 9 |   page.on('request', (req) => { 

can someone please help me with this?

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