TypeError: element.loader.split is not a function
See original GitHub issueThis throws an error:
}, {
test: require.resolve("jquery"),
loader: ["imports?$=jquery,jQuery=jquery"]
}],
This error:
$ webpack --config webpack.development.config.js -cd --progress --watch
20% 1/6 build modulesc:\Users\user\app\node_modules\webpack-core\lib\LoadersList.js:58
if(element.loader) return element.loader.split("!");
^
TypeError: element.loader.split is not a function
at getLoadersFromObject (c:\Users\user\app\node_modules\webpack-core\lib\LoadersList.js:58:43)
at LoadersList.<anonymous> (c:\Users\user\app\node_modules\webpack-core\lib\LoadersList.js:78:12)
at Array.map (native)
at LoadersList.match (c:\Users\user\app\node_modules\webpack-core\lib\LoadersList.js:70:19)
at c:\Users\user\app\node_modules\webpack\lib\NormalModuleFactory.js:111:68
at c:\Users\user\app\node_modules\async\lib\async.js:726:13
at c:\Users\user\app\node_modules\async\lib\async.js:52:16
at done (c:\Users\user\app\node_modules\async\lib\async.js:246:17)
at c:\Users\user\app\node_modules\async\lib\async.js:44:16
at c:\Users\user\app\node_modules\async\lib\async.js:723:17
at c:\Users\user\app\node_modules\async\lib\async.js:167:37
at c:\Users\user\app\node_modules\enhanced-resolve\lib\UnsafeCachePlugin.js:29:4
at onResolved (c:\Users\user\app\node_modules\enhanced-resolve\lib\Resolver.js:39:10)
at innerCallback (c:\Users\user\app\node_modules\enhanced-resolve\lib\Resolver.js:89:22)
at loggingCallbackWrapper (c:\Users\user\app\node_modules\enhanced-resolve\lib\createInnerCallback.js:21:19)
at c:\Users\user\app\node_modules\tapable\lib\Tapable.js:134:6
at c:\Users\user\app\node_modules\enhanced-resolve\lib\ModulesInDirectoriesPlugin.js:55:11
at c:\Users\user\app\node_modules\enhanced-resolve\lib\Resolver.js:191:15
at c:\Users\user\app\node_modules\enhanced-resolve\lib\ModulesInDirectoriesPlugin.js:46:14
at loggingCallbackWrapper (c:\Users\user\app\node_modules\enhanced-resolve\lib\createInnerCallback.js:21:19)
at c:\Users\user\app\node_modules\tapable\lib\Tapable.js:134:6
at c:\Users\user\app\node_modules\enhanced-resolve\lib\Resolver.js:123:21
at c:\Users\user\app\node_modules\enhanced-resolve\lib\Resolver.js:191:15
at applyPluginsParallelBailResult.createInnerCallback.log (c:\Users\user\app\node_modules\enhanced-resolve\lib\Resol
s:104:30)
at loggingCallbackWrapper (c:\Users\user\app\node_modules\enhanced-resolve\lib\createInnerCallback.js:21:19)
at c:\Users\user\app\node_modules\tapable\lib\Tapable.js:134:6
at Tapable.<anonymous> (c:\Users\user\app\node_modules\enhanced-resolve\lib\DirectoryDescriptionFilePlugin.js:68:32)
at loggingCallbackWrapper (c:\Users\user\app\node_modules\enhanced-resolve\lib\createInnerCallback.js:21:19)
at c:\Users\user\app\node_modules\enhanced-resolve\lib\Resolver.js:123:21
at c:\Users\user\app\node_modules\enhanced-resolve\lib\Resolver.js:191:15
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
element.loader.split is not a function - webpack - Stack Overflow
The problem is in your last loader. {test: /\.(jpe?g|png|gif|svg)$/i, loader: [ 'file?hash=sha512&digest=hex&name=[hash].
Read more >TypeError: element.loader.split is not a function #1465 - GitHub
Hello, I ran into this issue when running webpack: D:\__start\WorkOrderUI\node_modules\webpack\node_modules\webpack-core\li ...
Read more >TypeError: element.loader.split is not a function - Treehouse
"TypeError: element.loader.split is not a function". When I run my webpack-dev-server, I get the following error message in the console:.
Read more >element.loader.split is not a function-babel.js - appsloveworld
Coding example for the question Run webpack error information: element.loader.split is not a function-babel.js.
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 FreeTop 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
Top GitHub Comments
When you use the key “loader”, only a string is expected. Use “loaders” if you want ot pass an array.
Closing since this is a user error. In webpack v2 you’ll get a very clear error message for an error like this.