Files app showing the import error while importing npm modules in js folder

In the files app trying to import the node modules in the file “file-upload.js”. which gives the error “Cannot use import statement outside a module”…although node_modules folder and package.json folder are inside the files app.i have also tried adding type=“module”…it did not solve the issue.
PHP 7.2.24-0

Have you find a solution ?