capacitor-community / http

Community plugin for native HTTP
MIT License
208 stars 135 forks source link

Could not cast value of type '__NSCFNumber' (0x10881b608) to 'NSString' (0x1f473fc40). #256

Closed muuvmuuv closed 2 years ago

muuvmuuv commented 2 years ago

Describe the bug

Adding a number to http param produces the following error:

fieldId 2140
Could not cast value of type '__NSCFNumber' (0x107bf3608) to 'NSString' (0x1f473fc40).
2022-05-03 09:09:54.836692+0200 App[7297:240873] Could not cast value of type '__NSCFNumber' (0x107bf3608) to 'NSString' (0x1f473fc40).
dyld4 config: DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecording.dylib:/Developer/usr/lib/libMainThreadChecker.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib
(lldb) 

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

Numbers should correctly cast to NSString.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

muuvmuuv commented 2 years ago

Totally my bad. Our project has no strict typing and I wasn't checking what type Params is expecting. Will cast it to String in JavaScript first.