TypeError: query.select.split is not a function
See original GitHub issueMy team is seeing failures in the Contentful client since the update from 7.14.13 to 7.15.2.
Actual Behavior
We’re having numerous tests fail with the following error:
TypeError: query.select.split is not a function
at normalizeSelect (node_modules/contentful/dist/webpack:/contentful/utils/normalize-select.js:14:35)
at Object.getEntries (node_modules/contentful/dist/webpack:/contentful/create-contentful-api.js:216:20)
at getCachedContentfulEntriesOrFetch (src/clients/contentful/contentful-client.ts:616:44)`
FYI Updating to 8.0.3 exhibits the same error
TypeError: query.select.split is not a function
at normalizeSelect (/home/circleci/alma/api/node_modules/contentful/dist/webpack:/contentful/utils/normalize-select.js:14:35)
at Object.getEntries (/home/circleci/alma/api/node_modules/contentful/dist/webpack:/contentful/create-contentful-api.js:227:20)
at getCachedContentfulEntriesOrFetch (/home/circleci/alma/api/src/clients/contentful/contentful-client.ts:616:44)
Context
The client is breaking production code.
Environment
- Language Version: 12.20.0
- Operating System: Docker image
cimg/node:12.20.0
- Package Version: 7.15.2
- Which API are you using?: Delivery
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
What is causing the error `string.split is not a function`?
This is because document.location is a Location object. The default .toString() returns the location in string form, so the concatenation will trigger that....
Read more >How To Fix Split is Not a Function Error in JavaScript - Isotropic
split is not a function error. The Problem. First and foremost it is important to understand the usage of the split() method. It...
Read more >Error: split is not a function - JavaScript - SitePoint Forums
I'm trying to separate the 2 parts of the string into separate variables, but for whatever reason, the “split()” function won't work in...
Read more >[Solved] TypeError: split is not a function - ItsJavaScript
The TypeError: split is not a function occurs if we call a split() method on the value that is not of a type...
Read more >TypeError: split is not a function in JavaScript - Java2Blog
TypeError : .split is not a function occurs when we call split() function on object which is not an string. split() function can...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I added your use case to be officially supported so that all those also go through the correct select normalization procedure. The new version should be released in a few minutes.
In any case I think this should be a valid way of using the
select
operator since an array makes much more sense than a string with comma separated values, I’m mainly just wondering if the API actually accepted the payloads in a way that was not documented.