Closed callmeaponte closed 4 years ago
@callmeaponte thank you for the detailed report and I'm glad you like urlcat!
The reason for the discrepancy you noticed is that this library is currently in a transitional state. We have recently dropped URLSearchParams
in favor of qs to support array and object query params better and will soon release a new major version. This state is what you see on the master
branch. The latest release, v2.0.4, still depends on URLSearchParams
which you see in your node_modules
directory. As far as I know, qs supports older Node versions so after this change, urlcat will too (maybe not officially because our test tools may not support them, but the compiled result will most probably work fine).
The reason we haven't done a release yet is because we want to continue to support Deno which got a bit harder after we introduced a dependency.
You can expect the new release in the coming weeks. Until then, please check if v1.0.1 fits your needs (it was the latest release before v2.0.0 which introduced URLSearchParams
). If it doesn't, you can build the qs-based new version yourself and use it in your project as a temporary - though admittedly not very elegant - workaround.
Ah okay, makes sense. I'm going to switch to v1.0.1 for now, and make a note to check back here in a month or so for the new release. Thanks!
First of all, this is a very useful library - thank you for taking the time to build it.
Describe the bug The
URLSearchParams
call inindex.js
file causes the script to fail when running node.js < v10. For whatever reason, I only seeURLSearchParams
when npm installing this library - but when cloning it locally and running a build I don't:npm version
build version
To Reproduce Steps to reproduce the behavior:
URLSearchParams
does not exist in the global scope.Expected behavior I was expecting to see the same code when npm installing, as when I do when building this library locally.
Desktop (please complete the following information): N/A
Smartphone (please complete the following information): N/A
Additional context Without getting into too much detail about the project I'm working on - it uses SSR with a node version that is less than v10. Additionally, I don't have access to simply add a "URLSearchParams" global to act as a polyfill/workaround.