Uncaught ReferenceError: module is not defined at guacamole-common.min.js

533 views Asked by At

We are using guacamole-common-js in one of our projects and using guacamole-common.min.js in the script results in a module not found error:

   <script type="text/javascript" src="guacamole-common.min.js"></script>

console image

error in guacamole.min.js

I am using guacamole-common.js: 1.4.0-a

At first, I thought this might be related to guacamole-common.js version but I tried downgrading its version but still facing the same error.

1

There are 1 answers

0
Quentin On

The use of module.exports indicates that the file is a CommonJS module. This is the default module format of Node.js and is not supported by browsers.

Either:

  • You have a module designed for Node.js and not web browsers. There might be a browser targetted version available.
  • You have a module designed for use with a module bundling tool (such as Webpack or Parcel) and should use one of those to build your browser-side JS application.

Try carefully reading the documentation from wherever you downloaded the JS file from.