Browserify eslint require(...).pathToFileURL is not a function

712 Views Asked by At

I am trying to bundle the code below using browserify

const { ESLint } = require('eslint');
console.log(ESLint);

And when I include the generated bundle in a html file, I get this error.

Uncaught TypeError: require(...).pathToFileURL is not a function

When I checked the generated bundle I found that it contained require() function. Browserify should recursively replace all require() and combine them into one file, right? I am using Node.js version 14.15.1 and eslint version 8.13.0.

bundle.js

Is there something I've missed. Any help would be really appreciated. Thanks!

0

There are 0 best solutions below