Skip to content

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

@Vignesh-527

Description

@Vignesh-527

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions