bennymeg/IsraelPostalServiceAPI

Error Cannot read properties of null (reading 'signed')

atoyansk opened this issue · 0 comments

When I follow the docs, and my code is look like this:

import { IPS, Options } from 'israel-postal-service-api'; const weightInGrams = 20; const serviceType = Options.LocalMailOptions.PARCEL.shipmentType; const serviceSubtype = Options.LocalMailOptions.PARCEL.shipmentSubtypes.regular; const option = serviceSubtype.options.signed; const ips = new IPS(); ips.calculateShippingRate('Israel', weightInGrams, serviceType, serviceSubtype, option).then((response) => { // check out ResponseParser API to see all the available functions console.log(response.getTotalPrice()); }).catch((error) => { console.error('Error:', error); });

It displays an error:
Uncaught (in promise): TypeError: Cannot read properties of null (reading 'signed')