vue-konva icon indicating copy to clipboard operation
vue-konva copied to clipboard

Unexpected token import Electron-vue

Open PlayeMatthieu opened this issue 3 years ago • 0 comments

Trying to use Konva and vue-Konva on a Electron-vue project and getting this error: Uncaught SyntaxError: Unexpected token import at createScript (vm.js:80) at Object.runInThisContext (vm.js:139) at Module._compile (module.js:606) at Object.Module._extensions..js (module.js:653) at Module.load (module.js:561) at tryModuleLoad (module.js:504) at Function.Module._load (module.js:496) at Module.require (module.js:586) at require (internal/module.js:11) at webpackUniversalModuleDefinition (C:\Users\Gebruiker\Desktop\roofcalc\node_modules\vue-konva\umd\vue-konva.js:7)

package.json "dependencies": { "axios": "^0.18.0", "bulma": "^0.9.3", "konva": "^8.1.1", "vue": "^2.5.16", "vue-electron": "^1.0.6", "vue-konva": "^2.1.7" }, "devDependencies": { "ajv": "^6.5.0", "babel-core": "^6.26.3", "babel-loader": "^7.1.4", "babel-minify-webpack-plugin": "^0.3.1", "babel-plugin-transform-runtime": "^6.23.0", "babel-preset-env": "^1.7.0", "babel-preset-stage-0": "^6.24.1", "babel-register": "^6.26.0", "cfonts": "^2.1.2", "chalk": "^2.4.1", "copy-webpack-plugin": "^4.5.1", "cross-env": "^5.1.6", "css-loader": "^0.28.11", "del": "^3.0.0", "devtron": "^1.4.0", "electron": "^2.0.4", "electron-builder": "^20.19.2", "electron-debug": "^1.5.0", "electron-devtools-installer": "^2.2.4", "file-loader": "^1.1.11", "html-webpack-plugin": "^3.2.0", "listr": "^0.14.3", "mini-css-extract-plugin": "0.4.0", "node-loader": "^0.6.0", "node-sass": "^4.9.2", "sass-loader": "^7.0.3", "style-loader": "^0.21.0", "url-loader": "^1.0.1", "vue-html-loader": "^1.2.4", "vue-loader": "^15.2.4", "vue-style-loader": "^4.1.0", "vue-template-compiler": "^2.5.16", "webpack": "^4.15.1", "webpack-cli": "^3.0.8", "webpack-dev-server": "^3.1.4", "webpack-hot-middleware": "^2.22.2", "webpack-merge": "^4.1.3" }

main.js `import Vue from 'vue' import Konva from 'vue-konva'; import axios from 'axios' import App from './App'

Vue.use(Konva);

if (!process.env.IS_WEB) Vue.use(require('vue-electron')) Vue.http = Vue.prototype.$http = axios Vue.config.productionTip = false

/* eslint-disable no-new */ new Vue({ components: { App }, template: '<App/>' }).$mount('#app')`

App not starting on startup due to error

PlayeMatthieu avatar Jul 14 '21 11:07 PlayeMatthieu