problem with using jsts package in nest.js

22 views
Skip to first unread message

mahsa abadian

unread,
Dec 23, 2024, 9:18:57 AM12/23/24
to JSTS devs
I have problem using jsts package in my  nestjds server side project but I get error :


const geom_1 = require("jsts/org/locationtech/jts/geom");  
               ^
Error [ERR_REQUIRE_ESM]: require() of ES Module D:\pantoNestPro\panto-api\node_modules\jsts\org\locationtech\jts\geom.js from D:\pantoNestPro\panto-api\dist\src\point\point.service.js not supported.
Instead change the require of geom.js in D:\pantoNestPro\panto-api\dist\src\point\point.service.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (D:\pantoNestPro\panto-api\dist\src\point\point.service.js:83:16)
    at Object.<anonymous> (D:\pantoNestPro\panto-api\dist\src\event\event.service.js:48:25)
[5:45:38 PM] Found 0 errors. Watching for file changes.


D:\pantoNestPro\panto-api\dist\src\point\point.service.js:83
const geom_1 = require("jsts/org/locationtech/jts/geom");
               ^
Error [ERR_REQUIRE_ESM]: require() of ES Module D:\pantoNestPro\panto-api\node_modules\jsts\org\locationtech\jts\geom.js from D:\pantoNestPro\panto-api\dist\src\point\point.service.js not supported.
I have use dynamic import but it doesnot work.
I hope you can help me thanks in advance
Reply all
Reply to author
Forward
0 new messages