-
Notifications
You must be signed in to change notification settings - Fork 11
Description
Bug Description
I'm encountouring an issue with strapi client, the console throw this error:
Could not initialize the Strapi Client
I figured out that using the strapi client library on typescript project leads to browser incompatibility with the URL.canParse() function. In my case it happens on "old" devices with different browsers and browser versions that are not supporting this method.
The solution to solve the problem is to use polyfills:
https://github.com/zloirock/core-js#url-and-urlsearchparams
Steps to Reproduce
- Create an Angular 19 project
- Install the strapi client library
- Instanciate an instance of the strapi client
- Browse to your app on an old browser that doesn't support URL.canParse() method
Expected Behavior
The method polyfill should be implemented into the library to prevent getting this error on old browsers versions.
Here is the list of browsers and the versions that supports the method:
https://developer.mozilla.org/en-US/docs/Web/API/URL/parse_static
Version
1.4.0
Operating System
Other
Runtime Environment
Browser
Logs
Media
Confirmation Checklist
- I have checked the existing issues
- I agree to follow this project's Code of Conduct
- I would like to work on this issue