I try to import a js class and use its inner function. When I do this my page won't load due to an unknown error in the import line (when I remove the line page gets loaded).
The class:
export default class BombsMap {
constructor (block) {
this.block = block;
}
get bombsPlacing() {
// irrelevant code
return this.block;
}
static nearBombUpdate(rnd_i, rnd_j) {
// irrelevant code
}
}
The code from file2:
import BombsMap from './BombsMap';
const inst = new BombsMap(block);
I've tried to import only the function, to change the link to './BombsMap.js', and to import BombsMap with brackets such as { BombsMap }. None of these worked.