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 with vuetify have "Unexpected token <" error #146

Closed
dean9703111 opened this issue Mar 25, 2019 · 1 comment
Closed

NUXT with vuetify have "Unexpected token <" error #146

dean9703111 opened this issue Mar 25, 2019 · 1 comment

Comments

@dean9703111
Copy link

dean9703111 commented Mar 25, 2019

My version:

"dependencies": {
    "@nuxtjs/axios": "^5.3.6",
    "@nuxtjs/proxy": "^1.3.3",
    "age-calculator": "^1.0.0",
    "babel-runtime": "^6.26.0",
    "cross-env": "^5.2.0",
    "env-cmd": "^8.0.2",
    "lodash": "^4.17.10",
    "nuxt": "^2.4.0",
    "vue-pdf": "^4.0.6",
    "vuetify": "^1.5.5",
    "vuetify-loader": "^1.2.1"
  },

My code

<template>
  <div>
      {{currentPage}} / {{pageCount}}
      <pdf
        src="http://www.ycps.tp.edu.tw/mediafile/1934/news/154/2013-12/2013-12-19-9-55-10-nf1.pdf"
        @num-pages="pageCount = $event"
        @page-loaded="currentPage = $event"
        ref="myPdfComponent"
      />
      <button @click="$refs.myPdfComponent.print()">print</button>
  </div>
</template>
<script>
import pdf from '@/plugins/pdf'
export default {
  components: {
    pdf
  },
  data () {
    return {
      currentPage: 0,
      pageCount: 0
    }
  }
}

</script>

Result
image

I have try this method to fixed, but not work:
nuxt.config.js

 build: {
    transpile: ['vue-pdf'],
extend (config, { isServer }) {
      if (isServer) {
        console.log('isServer')
        config.externals += [
          require('webpack-node-externals')({
            whitelist: [/^vue-pdf/]
          })
        ]
      }
    }

have any idea? thank you very much

@FranckFreiburger
Copy link
Owner

Thanks for reporting. This is a known issue, see #13.

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

2 participants