TypeError: extensions.indexOf is not a function
Open
- Dominant language
- JavaScript
- Stars
- 1.7k
- Forks
- 112
- PR merge metrics
- No merged PRs in 30d
Description
When using `babelify --extensions [ .ts ] --presets [ @babel/preset-typescript ]` I get a TypeError.
```
TypeError: extensions.indexOf is not a function
.../node_modules/babelify/index.js:71:18)
```
Seems like extensions is an object `{ _: ['.ts'] }`
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the reported command and inspect babelify/index.js around line 71, where extensions.indexOf is called. Trace how the --extensions argument becomes { _: ['.ts'] }; done means the command accepts the TypeScript extension without the reported TypeError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100