placement.split() is not a function
See original GitHub issueI’m getting this error when Popper 2 getBasePlacement(placement) function is used in popper.js.
On that function, placement should be an string before split() is used. This get fixed just changing return placement.split('-')[0];
to return placement.toString().split('-')[0];
Issue Analytics
- State:
- Created a year ago
- Comments:5
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 >[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 | bobbyhadz
The "split is not a function" error occurs when we call the split() method on a value that is not of type string....
Read more >How To Fix Split is Not a Function Error in JavaScript - Isotropic
First and foremost it is important to understand the usage of the split() method. It can only be used on strings so the...
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 >
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
Thanks both @atomiks @doubleedesign, I was also making my own bundle for Bootstrap5, but adding
type="module"
to script tag fixed the issue.@atomiks Thank you!! Adding
type="module"
to the script tag has fixed it.In case it is useful to anyone: I am using Bootstrap’s tooltips but using the source files and my own bundling. I didn’t add the above because the Bootstrap docs specifically tell you not to, but I think that must just be if you’re using the pre-compiled version. If you’re using the source files and doing your own compiling, it’s not relevant and you should use
type="module"
.