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

Cannot use import statement outside a module #23

Open
chheng-dev opened this issue Apr 1, 2022 · 1 comment
Open

Cannot use import statement outside a module #23

chheng-dev opened this issue Apr 1, 2022 · 1 comment

Comments

@chheng-dev
Copy link

No description provided.

@RubensZaes
Copy link

Install libs:

npm i read-excel-file
npm i export-from-json

In @types create arquive 'vue-excel-xlsx.d.ts' containing:
declare module 'vue-excel-xlsx'

In plugins create excelLib.ts containing:

import VueExcelXlsx from "vue-excel-xlsx"
import Vue from 'vue'

Vue.use(VueExcelXlsx)

In nuxt.config.js add:
plugins: [ { src: "@/plugins/excelLib", mode: "client" }, ],

In package.json add:
"type": "module",

In tsconfig.json modify:

"target": "ES2018",
    "module": "ESNext",

to

"target": "esnext",
    "module": "commonjs",

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