question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: query.select.split is not a function

See original GitHub issue

My 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:closed
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
TimBeyercommented, Dec 7, 2020

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.

1reaction
TimBeyercommented, Dec 7, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found