Open cfdavidpetter opened 2 months ago
What version were you using when you got the error?
"shpjs": "5.0.0",
you're already using typescript, just import it like an es module
This should definitely be addressed. I can't use this in an AWS Lambda function for this exact reason.
Building from typescript results in a js file that always has require('shpjs')
even if you use a dynamic import()
import is the way the wind is blowing in node, I resisted it too but gave in. You can either use dynamic import or just use the old 4.x version.
Issue Description:
When using the shpjs library in a Node.js environment (specifically version 21.1.0), an error occurs related to the use of require() for ES modules, resulting in the following error:
Steps to Reproduce:
Expected Behavior:
The shpjs library should be usable in Node.js environments without encountering errors related to ES module syntax.
Environment:
Node.js version: 21.1.0 Operating System: Docker FROM node:21.1.0
Additional Information:
This issue was resolved by updating to version 4.0.4 of the shpjs library. However, it would be beneficial to ensure compatibility with older versions of Node.js or provide guidance on the supported Node.js versions in the library documentation.