JavaScript import statements changing to require after compilation

37 Views Asked by At

I have some JavaScript helper modules I use to access frequently used functions. It usually works fine but lately something weird is happening and I can seem to find a solution. So when I want to import the helper modules I add the following line;

import { debounce } from '../../../modules/helper-modules';

However, after I save the file and check the page and console I get the following error;

enter image description here

When I check where the error is coming from the import line from above has been changed to;

var _helperModules = require("../../../modules/helper-modules");

I can't seem to figure out how this is happening and online resources are non-existent. Has anyone run into this issue before?

I've checked every file connected to my main js file as well as my helper modules.

0

There are 0 best solutions below