Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nuxt: SyntaxError Unexpected token < #3

Open
fsproru opened this issue Nov 22, 2020 · 2 comments
Open

Nuxt: SyntaxError Unexpected token < #3

fsproru opened this issue Nov 22, 2020 · 2 comments

Comments

@fsproru
Copy link

fsproru commented Nov 22, 2020

When I import SvgIcon and add it as a component, I start getting Unexpected token < on page refresh in a Nuxt project.

Sample code

import SvgIcon from '@jamescoyle/vue-icon'
import { Component } from 'vue-property-decorator'

@Component({
  components: {
    SvgIcon
  }
})
export default class MyComponent extends Vue {
}
@JamesCoyle
Copy link
Collaborator

I'm guessing it's not being treated in the same way as a direct import and is expecting a JS Module instead of a Vue SFC. I'll look into solutions to this but I'm assuming I would need a build step to compile the SFC to a Module.

For now you can just import the component directly using import SvgIcon from '@jamescoyle/vue-icon/lib/svg-icon.vue'.

@abdoulmouctard
Copy link

abdoulmouctard commented Dec 24, 2020

There is missing value variable in flip validator

flip: {
    type: String,
    validator: () => ["horizontal", "vertical", "both"].includes(value),
},

👉 https://github.com/JamesCoyle/vue-icon/blob/51550e9d1a8f87b5026e429335ba3e0eee8c2e08/lib/svg-icon.vue#L39

Correction:

flip: {
    type: String,
    validator: (value) => ["horizontal", "vertical", "both"].includes(value),
},

MrFootwork added a commit to MrFootwork/armada-booking that referenced this issue Feb 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants