laravel-elixir-browserify
laravel-elixir-browserify copied to clipboard
'import' and 'export' may appear only with 'sourceType: module' (6:0)
gulpfile.js:
var elixir = require('laravel-elixir');
require('laravel-elixir-vueify');
elixir(function(mix) {
mix.browserify('vue.js');
});
vue.js:
var Vue = require('vue');
import CriticalState from './components/CriticalState.vue';
new Vue({
el: '#dashboard',
components: { CriticalState },
});
CriticalState.vue:
<template>
{{ id }}
</template>
<script>
export default {
props: ['id']
}
</script>
package.json
{
"private": true,
"scripts": {
"prod": "gulp --production",
"dev": "gulp watch"
},
"devDependencies": {
"bootstrap-sass": "^3.0.0",
"gulp": "^3.9.1",
"laravel-elixir": "^5.0.0",
"laravel-elixir-webpack-official": "^1.0.4",
"vue": "^1.0.26",
"vueify": "^8.7.0"
},
"dependencies": {
"laravel-echo": "~1.0.0",
"pusher-js": "~3.2.1",
"laravel-elixir-browserify-official": "~0.1.3",
"babel-preset-es2015": "~6.13.2",
"babel-preset-react": "~6.11.1"
}
}
versions:
npm -v
2.15.9
node -v
v4.5.0
When running gulp I get the following error:
Error: Parsing file /.../resources/assets/js/components/CriticalState.vue: 'import' and 'export' may appear only with 'sourceType: module' (6:0)
Am I missing something?
Having the same issue over here.
What version of Laravel Elixir are you running?
5.0
Can you update your npm and Node dependencies to the latest release?
Same problem here. I tried this in app.js: import addClass from 'vanillajs-browser-helpers/addClass';
. Same error.
node: v6.9.5
[email protected]
[email protected]
Any news on this? Thanks.
I had to redo my dev setup and I wasn't able to reproduce it after that.
@matthenning Tell me please did manage to find any solution ? I just have a similar problem now. Thank you in advance for your response.
I'm afraid I had to set up my dev environment from scratch and my issues disappeared. The problem was almost certainly somewhere on my end, but I could not identify it.
@matthenning Got it, thanks