I have created a PCF (Powerapps Component Framework) in which I am using the GEOCODE feature. I have installed the required components using "npm install node-geocoder" and have added the below code :
let nodeGeocoder = require('node-geocoder');
let options = {
provider: 'openstreetmap'
};
let geoCoder = nodeGeocoder(options);
geoCoder.geocode('Luray Caverns')
.then((res)=> {
console.log(res[0].latitude);
console.log(res[0].longitude);
})
.catch((err)=> {
console.log(err);
});
When i build this code using "npm run build", the build fails with following error: ERROR in ./node_modules/request/lib/har.js Module not found: Error: Can't resolve 'fs' in 'D:\PCF\Demo\node_modules\request\lib'
Module not found: Error: Can't resolve 'net' in 'D:\PCF\Demo\node_modules\forever-agent' ERROR in ./node_modules/node-geocoder/lib/geocoder/agolgeocoder.js Module not found: Error: Can't resolve 'net' in 'D:\PCF\Demo\node_modules\node-geocoder\lib\geocoder'
ERROR in ./node_modules/node-geocoder/lib/geocoder/datasciencetoolkitgeocoder.js Module not found: Error: Can't resolve 'net' in 'D:\PCF\Demo\node_modules\node-geocoder\lib\geocoder'
ERROR in ./node_modules/node-geocoder/lib/geocoder/abstractgeocoder.js Module not found: Error: Can't resolve 'net' in 'D:\PCF\Demo\node_modules\node-geocoder\lib\geocoder'
Any help would be helpful.
Thanks in advance.
Hello Rahul,
I believe you would be better off opening a support case for this with our Power Apps team as this may require a debug of logging. We will leave this post open for the community to answer as well.
Ken Hubbard
Dynamics Support
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156