Cannot use import statement outside a module when using ECMAScript 6

Getting Uncaught SyntaxError: Cannot use import statement outside a module when using ECMAScript 6

To fix the issue, it is highly recommended to include type="module" in the script tag.

By adding the type="module" attribute, you instruct the browser to treat the script as an ECMAScript module, ensuring it follows the correct rules for resolving dependencies and executing the code.

Hi,

Replace import with require().

Try this:

import { parse } from 'node-html-parser';
parse = require('node-html-parser');
Or try this:
// import { parse } from 'node-html-parser';
parse = require('node-html-parser');