How to pass variable in require

0

I'm trying to pass a populated variable through the database, containing my route to require, but it's giving the following error:

"Cannot find module 'views/Cadastros/Usuario'"

And these are the forms that I tried to import and unfortunately did not work

var component = require("" + listRouters[i].import).default 

var component = await (await import(listRouters[i].import).default;

var component = import(listRouters[i].import)
    
asked by anonymous 29.10.2018 / 14:21

0 answers