Error: The moduleSpecifier has no scheme

Hello everyone, currently I am deleting everything node related from my project to get rid of webpack bundler in order to run k6 without the need of it, keeping a simple execution. I was using .env file for environment variables using process.env to export them. Now I am using simple env.js file exporting every variable and importing the file with relative path as k6/modules documentation suggest. Here you have whole view:

when I execute k6 run tests/groups/users.js I get the error message >> WARN[0000] The moduleSpecifier "tests/Common.js" has no scheme but we will try to resolve it as remote module. This will be deprecated in the future and all remote modules will need to explicitly use "https" as scheme. ERRO[0000] Module specifier "tests/Common.js" was tried to be loaded as remote module by prepending "https://" to it, which didn't work. If you are trying to import a nodejs module, this is not supported as k6 is _not_ nodejs based. Please read for more information. Remote resolution error: "Get "https://tests/Common.js": dial tcp: lookup tests: no such host" at*InitContext).Require-fm (native) at file:///Users/nil.pascual/Developer/load-performance/tests/groups/users.js:2:0(26) hint="script exception"

I know this is related to some kind of modules errors but now I am doing everything as k6 documentation says. What am I doing wrong? Thank you so much!

Hi @NilPascual,
did you try doing what the error message is saying so using a scheme? Your module is local so you should use something like ./tests/... and not just tests/....

Let me know if it helps.

Hi @codebien ,
Thank you for answering, now I am using absolute paths in all of my imports and it’s working! Thank you so much for the idea. For anyone who doesn’t know how to do it, just right click the file you want to import and click on ‘copy absolute path’ then put that path on the import, it’s not as cool as a relative path import but is what it works.

Edit: Also I can use same relative paths but have to add the file extension (ex: .js) to them!
Thanks again!