In my case, I was getting the error because I upgraded from Laravel Mix Version 2 to 5.
In Laravel Mix Version 2, you import vue components as follows:
Vue.component( 'example-component', require('./components/ExampleComponent.vue') );
In Laravel Mix Version 5, you have to import your components as follows:
import ExampleComponent from './components/ExampleComponent.vue'; Vue.component('example-component', ExampleComponent);
Here is the documentation: https://laravel-mix.com/docs/5.0/upgrade
Better, to improve performance of your app, you can lazy load your components as follows:
Vue.component("ExampleComponent", () => import("./components/ExampleComponent"));
Related Posts:
- How to solve ‘Redirect has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header’?
- forEach is not a function error with JavaScript array
- Vue is not defined
- Vue ‘export default’ vs ‘new Vue’
- SyntaxError: Unexpected token o in JSON at position 1
- What does the function then() mean in JavaScript?
- Understanding unique keys for array children in React.js
- (Google Map API) Geocode was not successful for the following reason: REQUEST_DENIED
- Generate random number between two numbers in JavaScript
- Difference between npx and npm?
- How do I copy to the clipboard in JavaScript?
- Array of JSON Objects
- Cannot read property ‘push’ of undefined when combining arrays
- Can’t resolve module (not found) in React.js
- Is there a difference between /\s/g and /\s+/g?
- How to read an external local JSON file in JavaScript?
- How to call an async arrow function with await
- Get the current URL with JavaScript?
- How do I empty an array in JavaScript?
- How do I chop/slice/trim off last character in string using Javascript?
- What is causing this error – “Fatal error: Unable to find local grunt”
- Escape quotes in JavaScript
- “Uncaught (in promise) undefined” error when using with=location in Facebook Graph API query
- Firebase Permission Denied
- Using Javascript in CSS
- How can I mock an ES6 module import using Jest?
- What is “assert” in JavaScript?
- JavaScript variable assignments from tuples
- jQuery $.cookie is not a function
- Setting background-image using jQuery CSS property
- What is ESNext?
- SyntaxError: Cannot use import statement outside a module
- Appending to an object
- What is the meaning of “$” sign in JavaScript
- How to determine the installed webpack version
- Error: Failed to execute ‘appendChild’ on ‘Node’: parameter 1 is not of type ‘Node’
- How to validate date with format “mm/dd/yyyy” in JavaScript?
- How can I group data with an Angular filter?
- jQuery disable/enable submit button
- Uncaught Invariant Violation: Too many re-renders. React limits the number of renders to prevent an infinite loop
- node-request – Getting error “SSL23_GET_SERVER_HELLO:unknown protocol”
- React.js – Can’t read property of undefined
- SyntaxError: import declarations may only appear at top level of a module
- Jest TypeError: Path must be a string. Received undefined
- JQuery issue “TypeError: $.getJSON is not a function”
- Why is marquee deprecated and what is the best alternative?
- For loop for HTMLCollection elements
- Cannot read property ‘length’ of null (javascript)
- Caesar Cipher in Javascript
- Maximum call stack size exceeded on npm install
- Return array from function
- Why define an anonymous function and pass it jQuery as the argument?
- Error parsing XHTML: The content of elements must consist of well-formed character data or markup
- How to scroll an HTML page to a given anchor
- Javascript call() & apply() vs bind()?
- Creating Accordion Table with Bootstrap
- Creating Multiple Modals on a Single Page
- How to check if the URL contains a given string?
- Check if url contains string with JQuery
- what is the best way to check variable type in javascript
- JavaScript Array Push key value
- stopPropagation vs. stopImmediatePropagation
- How to replace regular jquery calls with CDN calls from Google?
- Editing Source Code in WordPress
- wp_enqueue_script isn’t connecting my custom js file
- How do I fire a snackbar notice in admin?
- How/Where is editor.min.js Added to the wp-admin Post Page?
- Should a WordPress plugin polyfill the global JS environment?
- Close TinyMCE plugin window on click away
- Running JS after theme customizer finished initialization
- Script Localization doesn’t work
- How to add custom javascript into from custom plugin
- remove inline scripts from the_content() produced by plugins?
- Help display image in single post using javascript zoom image..?
- How to conditionally show/hide controls & sections in WordPress customizer?
- Uncaught TypeError [closed]
- Checks when fetching data from multiple REST API endpoints in Gutenberg
- How to get the title of the item that is clicked on
- Correct way to include extra styles & script files?
- How can I allow HTML in Gutenberg UI elements help text?
- How do I make my wordpress post appear in a mouse hover preview?
- UnitControl – Block has encountered an error
- Should I manually resolve WP Core File security issues or await a subsequent WP release?
- Uncaught TypeError: switchEditors.switchto is not a function
- Check if user can in javascript
- Rest API and how to deal with it in server side
- Is it possible to override only a part of another plugin’s / theme’s js (asset) file?
- Gutenberg – dynamically created element: how to set onChange?
- JSX SVG Icon with WordPress
- VisualComposer/WPBakery Page Editor: Is any JS event triggered after the Edition pop-in is shown?
- How do I integrate a codepen?
- Can I just insert JavaScript by using ?
- Gutenberg Edit Block Inspector Controls and save
- JavaScript and Google PageSpeed + wp_enqueue_script
- How to modify a class in load-scripts.js ?
- How to integrate a different (JavaScript) editor in WordPress?
- Trigger a function during onload
- Add Javascript/Html into a WordPress
- Why is this script not working?
- Astra Mobile Cart Drawer is blank on home page