Closed prachaquanttech closed 6 years ago
Update if I remove properties, cacheSize and poolSize from the config, Code will run fine.
Hi There
You should only need to remove poolSize as this is a Pattern only option. Hash Trie does not have a workset pool like Pattern. It's matches consist of Device offsets which are smaller than Pattern worksets. As a result they are calculated on the fly.
Let me know how you get on.
Thanks for the answer if add "properties" option back, It will throw "segmentation fault".
Which version of the data file are you using currently?
51Degrees-EnterpriseV3.4.trie
Of course, sorry ignore me.
I have modified the example above with some changes to the configuration. Properties are not stored as an array but as a comma separated string. The keys in the config are also surrounded by quotes.
Try this and let me know what you get back.
Would you also be able to send over the code where you reference the Device Detection module in: DeviceDetection.provider
const fiftyonedegreescoreConfig = {'dataFile' : 'static/51degrees/51Degrees-EnterpriseV3.4.trie',
'properties' : 'HardwareVendor,HardwareModel,HardwareFamily,PriceBand,PlatformName,PlatformVersion,ScreenPixelsHeight,ScreenPixelsWidth,ReleaseMonth,ReleaseYear,DeviceType,HardwareModelVariants'}
const provider = DeviceDetection.provider(fiftyonedegreescoreConfig)
const match = provider.getMatch(ctx.header['user-agent'])
match.close()
This code work
const fiftyonedegreescoreConfig = {'dataFile' : 'static/51degrees/51Degrees-EnterpriseV3.4.trie',
'properties' : 'HardwareVendor,HardwareModel,HardwareFamily,PriceBand,PlatformName,PlatformVersion,ScreenPixelsHeight,ScreenPixelsWidth,ReleaseMonth,ReleaseYear,DeviceType,HardwareModelVariants'}
const provider = DeviceDetection.provider(fiftyonedegreescoreConfig)
const match = provider.getMatch(ctx.header['user-agent'])
match.close()
BTW we use module this in Koa.js. Can I write provider.getMatch(ctx.request)
like in Express.js?
Thanks a lot
using this config
Error: Illegal arguments for construction of _exports_Provider
Please help