kontent-ai / delivery-sdk-js

Kontent Delivery SDK for Javascript
https://kontent.ai
MIT License
50 stars 34 forks source link

Error: "Invalid language codename" after updating to 14.3.0 #372

Closed sahibalejandro closed 1 year ago

sahibalejandro commented 1 year ago

Brief bug description

After updating from 14.2.0 to 14.3.0 I'm receiving the error message Invalid language codename when trying to fetch data, eg: deliveryClient.item('some_item');.

When I rollback the update and go back to 14.2.0 it works as expected.

Probably related with this change: https://github.com/kontent-ai/delivery-sdk-js/commit/951bf26ab549fe0035efb312718b5cf7a39f7d47

In my project we have been using language codes with dashes like en-US for years, this new language validation could be a breaking change since it only matches letters, numbers and underscores.

I'll happy to send a PR if necessary.

Repro steps

  1. Update to version 14.3.0

Expected behavior

Fetch data from Kontent.ai continue to work as expected.

Test environment

Enngage commented 1 year ago

@sahibalejandro thank you for letting us know! I'm reverting this change as it's probably not worth validating the codename value by the SDK so it should work as before in @14.3.1

sahibalejandro commented 1 year ago

@Enngage thank you for the quick response, I'll update the dependency again and try 👍🏼

sahibalejandro commented 1 year ago

Worked fine now 👍🏼