Uncaught TypeError: icon.register is not a function
See original GitHub issueI’m getting Uncaught TypeError: icon.register is not a function when compiling using Laravel-Mix watch and Browsersync. The initial compile is fine but when I edit a file which has an svgicon element in it the reload gives me that error. All of my svgicon elements are in Vue components.
NPM Packages installed using default configs:
- axios@0.16.2
- browser-sync@2.18.13
- browser-sync-webpack-plugin@1.2.0
- cross-env@5.0.5
- laravel-mix@1.4.2
- lodash@4.17.4
- moment@2.18.1
- vue@2.4.2
- vue-router@2.7.0
- vue-svgicon@1.2.6
The part of my compiled app.js file that is erroring:
var icon = __webpack_require__(1);
icon.register({
'add-to-stack': {
width: 16,
height: 16,
viewBox: '0 0 20.35 20.35',
data: '<defs><clipPath id="a"><path pid="0" class="a" d="M.98 0h18.4v20.35H.98z"/></clipPath></defs><path pid="1" class="b" d="M1.38 15.55l8.8 4.4 8.8-4.4-8.8-4.4-8.8 4.4z"/><g class="c"><path pid="2" class="d" d="M1.38 15.55l8.8 4.4 8.8-4.4-8.8-4.4-8.8 4.4z"/></g><path pid="3" class="b" d="M1.38 13.78l8.8 4.4 8.8-4.4-8.8-4.4-8.8 4.4z"/><g class="c"><path pid="4" class="d" d="M1.38 13.78l8.8 4.4 8.8-4.4-8.8-4.4-8.8 4.4z"/></g><path pid="5" class="b" d="M1.38 12l8.8 4.4 8.8-4.4-8.8-4.4-8.8 4.4z"/><g class="c"><path pid="6" class="d" d="M1.38 12l8.8 4.4 8.8-4.4-8.8-4.4-8.8 4.4z"/><path pid="7" class="b" d="M10.18 11.2A5.2 5.2 0 1 0 5 6a5.2 5.2 0 0 0 5.2 5.2"/><path pid="8" class="e" d="M16.17 6a6 6 0 1 0-6 6 6 6 0 0 0 6-6m-2.5.5a.5.5 0 0 1-.5.5h-2v2a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5V7h-2a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h2V3a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v2h2a.5.5 0 0 1 .5.5z"/></g>'
}
});
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Uncaught TypeError: icon.register is not a function · Issue #27
I'm getting Uncaught TypeError: icon.register is not a function when compiling using Laravel-Mix watch and Browsersync.
Read more >Uncaught TypeError: icon.hasName is not a function
I'm getting a console error "Uncaught TypeError: icon.hasName is not a function" when I'm using my mobile navigation using the hamburger ...
Read more >Uncaught TypeError | Is Not A Function | Solution - YouTube
Have you encountered an error like:- Uncaught TypeError - Some selector is not a function - jQuery is not a function - owlCarousel...
Read more >Uncaught TypeError: $link[icon_placement] is not a function
On my node editing form, I am getting the error Uncaught TypeError: $link[icon_placement] is not a function in the JavaScript console.
Read more >Trouble loading icons in ACF editor
Uncaught TypeError : acf.escHtml is not a function at args.escapeMarkup (input-v5.js?ver=3.1.2:42) at d.e.display (select2.full.min.js?ver=4.0:1) at ...
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

And I think it’s related to this issue: https://github.com/JeffreyWay/laravel-mix/issues/1084
So not a problem with vue-svgicon. I’ll close this.
Thanks.
anyone fix that?