-
Notifications
You must be signed in to change notification settings - Fork 157
SyntaxError: Unexpected token < #12
Comments
What does your build chain look like? Are you using vue-cli? |
I am using this project as my base: https://github.com/SimulatedGREG/electron-vue This is the I am trying to import the I'm not sure what the issue is as other packages are being imported fine in the same Component vue I've also tried to import in the |
Thanks for setting up the project and helping! I've managed to fix the issue. For reasons i'm not sure of (yet), I had to explicitly import the Component like this:
|
Still not working. Also I use @HasnatH but still its not working instead it says |
I was getting the same error using nuxt in I solved creating a nuxt plugin with ssr disabled: // plugins/autocomplete.js
import Vue from 'vue'
import VueBootstrapTypeahead from 'vue-bootstrap-typeahead'
Vue.component('v-autocomplete', VueBootstrapTypeahead) // nuxt.config.js
{
plugins: [
{ src: '~/plugins/autocomplete', ssr: false }
]
} Idk why it happens, but apparently this solve the problem. |
For me, it happens when page is reloaded. ( I am using nuxt too ) |
@danielbonifacio |
@danielbonifacio Does adding ssr false just mean the component won't show up when the server renders the component? |
@tettoffensive It means that the component will be rendered only on the client-side. Nuxt will only have a reference to where it should be on the template, but will not mount or execute it. That's because a server rendering does not have some APIs, like |
I managed to get the vue-typeahead-bootstrap component to render server side as well in a nuxt application by configuring the vue-typeahead-bootstrap component to be transpiled in nuxt.config.js:
|
I have added
vue-bootstrap-typeahead
to my project as follows:npm i vue-bootstrap-typeahead --save
I have other components I am importing such as
vue-bootstrap-datetimepicker
like this:import DatePicker from 'vue-bootstrap-datetimepicker'
However, when I try to import the
vue-bootstrap-typeahead
like this:import VueBootstrapTypeahead from 'vue-bootstrap-typeahead'
I get the following error:
SyntaxError: Unexpected token <
I have also tried to use
require
but face the same error:var VueBootstrapTypeahead = require('vue-bootstrap-typeahead')
I haven't even added it to my
components
or to mytemplate
Please advise why I might be having this issue.
Thanks.
The text was updated successfully, but these errors were encountered: