Closed hadelnasr closed 4 years ago
I'm not familiar with this error.
Can you provide the whole vue comp?
I don't know exactly what do you mean by vue comp but find below my code
Testing data
just simple import without even usage in the page but it throws an error directly
and also find my package.json file
{ "name": "nafeza-portal", "version": "1.0.0", "description": "Nafeza - The National Single Window for Trade", "author": "MTS", "private": true, "scripts": { "dev": "nuxt --port 8080", "build": "nuxt build", "start": "nuxt start --port 8080", "generate": "nuxt generate", "test": "jest" }, "dependencies": { "@enso-ui/tables": "^1.4.3", "@enso-ui/toastr": "^1.0.31", "@nuxtjs/axios": "^5.9.5", "@nuxtjs/device": "^1.2.7", "@nuxtjs/dotenv": "^1.4.1", "animated-number-vue": "^1.0.0", "axios": "^0.19.2", "bootstrap": "^4.1.3", "bootstrap-vue": "^2.5.0", "i18n-iso-countries": "^4.3.1", "js-cookie": "^2.2.1", "moment": "^2.24.0", "moment-timezone": "^0.5.27", "nuxt": "^2.0.0", "nuxt-env": "^0.1.0", "vue-awesome-countdown": "^1.0.23", "vue-awesome-swiper": "^3.1.3", "vue-country-flag": "^1.3.1", "vue-i18n": "^8.15.3", "vue-infinite-scroll": "^2.0.2", "vue-owl-carousel": "^2.0.3", "vue-pincode-input": "0.0.5", "vue-recaptcha": "^1.3.0", "vue-recaptcha-v3": "^1.8.0", "vue-simple-addthis-share": "^0.1.4", "vuejs-datepicker": "^1.6.2", "vuelidate": "^0.7.5" }, "devDependencies": { "@vue/test-utils": "^1.0.0-beta.27", "babel-jest": "^24.1.0", "eslint": "^6.8.0", "eslint-loader": "^3.0.3", "jest": "^25.1.0", "node-sass": "^4.13.1", "postcss-loader": "^3.0.0", "sass-loader": "^8.0.2", "vue-jest": "^4.0.0-0" } }
I'm not familiar with nuxt but generaly vue eslint won't let you import a component that you're not using in your template.
no i'm not using eslint, i'm disabling it
You shouldn’t be able to compile either.
This is a bug.
Prerequisites
Description
After npm installing the package and starting to import it inside nuxtjs project it gave me this weird error : SyntaxError Cannot use import statement outside a module
Steps to Reproduce
npm -v: 6.13.4 node -v: v12.16.1
1.npm install @enso-ui/tables @enso-ui/toastr 2.import { VueTable } from '@enso-ui/tables/bulma'; 3.refresh the page => error occured
Expected behavior
draw the table
Actual behavior
SyntaxError Cannot use import statement outside a module