Hi!
I’m trying to use AWS Signature v4 to authenticate my api calls in k6. I have followed the guide, but when i try to run the test locally i get an error pointing to the automatically generated (and enormous) file aws4.js:
ERRO[0000] SyntaxError: file:///C:/Users/tjackenpacken/source/repos/TestApi/tests/aws4.js: Unexpected character '�' (1:0)
> 1 | ��(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.aws4 = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
| ^
2 |
3 | 'use strict';
4 |
at <internal/k6/compiler/lib/babel.min.js>:2:28542(109)
at <internal/k6/compiler/lib/babel.min.js>:14:24413(13)
at s (<internal/k6/compiler/lib/babel.min.js>:1:1331(8))
at reflect.methodValueCall (native)
at file:///C:/Users/tjackenpacken/source/repos/TestApi/tests/the-real-test-copy.js:14:177(41)
at reflect.methodValueCall (native)
at file:///C:/Users/tjackenpacken/source/repos/TestApi/tests/hello-world.js:1:107(13) hint="script exception"
I think it looks like some sort of decoding issue, but i can’t figure out how to solve it. Anyone has any ideas?