You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been having a few different issues importing from ES6 modules that have otherwise worked that have had me to refactor some of my existing code in order to get it working with K6.
Importing from files requires the .js file extension when an ES6 module ordinarilly would not.
Example - if my module is written to: import ClassName from './classFile'; I will receive the error that 'The system cannot find the file specified', if I change this line to import ClassName from './classFile.js'; it works fine
Importing from index files does not seem to work appropriately.
Example, if I have any kind of indexing file that may be common in ES modules:
import Class1 from './class1File.js';
import Class2 from './class2File.js';
export default {
Class1,
Class2
};
if I attempt to import the above file and then create new instances of Class1 and Class2 (as I would be able to normally in an ES6 module), I cannot - however, if I directly import them from class1File and class2File, I am able to do so
The text was updated successfully, but these errors were encountered:
I am closing this as this was most likely fixed in #1099 merged with commit bd6d2d9 . I did try to reproduce this bug in previous versions ... but it worked all the way back to 0.19.0 and I decided that probably my example isn't using what is broken.
If this is still not resolved please reopen the issue and provide a full example that fails.
I've been having a few different issues importing from ES6 modules that have otherwise worked that have had me to refactor some of my existing code in order to get it working with K6.
Example - if my module is written to: import ClassName from './classFile'; I will receive the error that 'The system cannot find the file specified', if I change this line to import ClassName from './classFile.js'; it works fine
Example, if I have any kind of indexing file that may be common in ES modules:
import Class1 from './class1File.js';
import Class2 from './class2File.js';
export default {
Class1,
Class2
};
if I attempt to import the above file and then create new instances of Class1 and Class2 (as I would be able to normally in an ES6 module), I cannot - however, if I directly import them from class1File and class2File, I am able to do so
The text was updated successfully, but these errors were encountered: