Chilkat Forum

Programming Languages / Environments => Node.js / Electron => Topic started by: kennyd on January 16, 2018, 10:04:54 AM

Title: How do we include chilkat.node in React application?
Post by: kennyd on January 16, 2018, 10:04:54 AM
I am working on a project using Chilkat in a React application. We've got the node module installed, but whenever we try to use it, I get an error that seems like it is trying to read the chilkat.node file as a JavaScript file instead of a raw .node module.

We've tried all kinds of combinations between import and require, and have been trying to use the node-loader module. If we do node-loader, we get "Uncaught error, cannot open PATH_TO/chilkat.nodeCannot read property 'dlopen' of undefined."

Without node-loader, we get "Uncaught error: module parse failed. Unexpected character '�' You may need an appropriate loader to handle this file type."

What do we need to add to get webpack and node.js to use Chilkat?
Title: Re: How do we include chilkat.node in React application?
Post by: Chilkat on January 17, 2018, 10:19:12 AM
I really don't know anything about React, and the ability to answer this question requires knowledge of React.  That being said, my first question would be "Where does the Javascript run?"   If it's client-side (in the Browser), then there's no way the chilkat.node would or could run because the chilkat.node is native code (not Javascript).  You'd have to be running the javascript server-side..
Title: Re: How do we include chilkat.node in React application?
Post by: kennyd on January 17, 2018, 12:50:23 PM
Thanks for the response. React is indeed all client-side JavaScript.