# Transpilation issue

**URL:** <https://community.grafana.com/t/transpilation-issue/97933>\
**Category:** OSS Support\
**Created:** [June 29, 2022, 8:15am UTC](https://community.grafana.com/t/transpilation-issue/97933 "2022-06-29T08:15:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gfyrag](https://avatars.discourse-cdn.com/v4/letter/g/59ef9b/32.png) [@gfyrag](https://community.grafana.com/u/gfyrag)\
**Post date:** [June 29, 2022, 8:15am UTC](https://community.grafana.com/t/transpilation-issue/97933/1 "2022-06-29T08:15:37Z")

</div>

Hello!  
I’m trying to use the library “openapi-request-validator” with K6.  
I used the following template : [GitHub - grafana/k6-template-typescript: Template to use TypeScript with k6](https://github.com/grafana/k6-template-typescript)  
When running, K6 fail with an error :

```auto
ERRO[0000] SyntaxError: file:///Users/geoffreyragot/Work/numary/k6/dist/all-test.js: Unexpected token (1962:24)
  1960 | binary: true
  1961 | };
> 1962 | exports.fastFormats = { ...exports.fullFormats,
       | ^

```

It seems to be a transpilation issue.  
The code which use the syntax is located at “node\_modules/openapi-request-validator/node\_modules/ajv-formats”.  
I don’t find how to indicate to babel to transpile this module.  
Any idea?

---

<div class="post-metadata">

**Author:** ![mstoykov](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/mstoykov/32/35309_2.png) [@mstoykov](https://community.grafana.com/u/mstoykov)\
**Post date:** [June 29, 2022, 1:10pm UTC](https://community.grafana.com/t/transpilation-issue/97933/3 "2022-06-29T13:10:28Z")

</div>

Hi @gfyrag, welcome to the community forum!

I’ve managed to find a way to fix this and likely will make a PR to the main repo(as there are quire a bit). Unfortunately I then hit a different issue with regexp for which I have [opened a PR](https://github.com/dlclark/regexp2/pull/52) which is not going to get in the v0.39.0 we are about to release next week.

This likely means that a fix for this will be merged in the release after that, but maybe it will have to wait for v0.40.0 in two months ☹

Will keep this post updated on the issue as well.

---

<div class="post-metadata">

**Author:** ![gfyrag](https://avatars.discourse-cdn.com/v4/letter/g/59ef9b/32.png) [@gfyrag](https://community.grafana.com/u/gfyrag)\
**Post date:** [June 29, 2022, 1:14pm UTC](https://community.grafana.com/t/transpilation-issue/97933/4 "2022-06-29T13:14:52Z")

</div>

Ok, thks. I will find another solution and retry when the release will be available 🙂

---

<div class="post-metadata">

**Author:** ![mstoykov](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/mstoykov/32/35309_2.png) [@mstoykov](https://community.grafana.com/u/mstoykov)\
**Post date:** [June 29, 2022, 1:30pm UTC](https://community.grafana.com/t/transpilation-issue/97933/5 "2022-06-29T13:30:56Z")

</div>

@gfyrag can you try the changes from [node modules weren't transpiled by babel by mstoykov · Pull Request #25 · grafana/k6-template-typescript · GitHub](https://github.com/grafana/k6-template-typescript/pull/25)

With those and the latest v0.38.3 I managed to make a very basic script work

---

<div class="post-metadata">

**Author:** ![mstoykov](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/mstoykov/32/35309_2.png) [@mstoykov](https://community.grafana.com/u/mstoykov)\
**Post date:** [July 7, 2022, 6:44am UTC](https://community.grafana.com/t/transpilation-issue/97933/6 "2022-07-07T06:44:45Z")

</div>

@gfyrag have you had time to try the changes I linked?
