Skip to content
This repository was archived by the owner on Jul 26, 2023. It is now read-only.

laravel when saving sass giving error "Cannot set property '__file' of undefined" but working when saving js ..... every time mix build successful #303

Open
jahidhsn002 opened this issue Aug 17, 2017 · 2 comments

Comments

@jahidhsn002
Copy link

laravel when saving sass giving error

app.js:sourcemap:50945 Uncaught TypeError: Cannot set property '__file' of undefined
at Object.defineProperty.value (app.js:sourcemap:50945)
at webpack_require (app.js:sourcemap:20)
at Object.VERSION (app.js:sourcemap:1139)
at webpack_require (app.js:sourcemap:20)
at Object. (app.js:sourcemap:1079)
at webpack_require (app.js:sourcemap:20)
at app.js:sourcemap:63
at app.js:sourcemap:66

but working when saving js ..... every time mix build successful

webpack.mix.js

let mix = require('laravel-mix');
mix.js('resources/assets/js/app.js', 'public/js')
.stylus('resources/assets/stylus/app.styl', 'public/css/stylus.css')
.sass('resources/assets/sass/app.scss', 'public/css/sass.css');

app.scss

// Fonts
@import url("https://fonts.googleapis.com/css?family=Material+Icons");
@import url("https://fonts.googleapis.com/css?family=Roboto:300,400,500,700");
// Variables
@import "help";
@import "variables";
// Application
@import "override";

app.js

window._ = require('lodash');
/**
*

  • Libraries

/
try {
// jQuery
window.$ = window.jQuery = require('jquery');
// Axios
window.axios = require('axios');
// Vue.js
window.Vue = require('vue');
// Vuetify
window.Vuetify = require('vuetify');
} catch (e) {}
/
*
*

  • Setup

/
try {
// Plugins
Vue.use(Vuetify);
// Ajax header
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
let token = document.head.querySelector('meta[name="csrf-token"]');
window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content;
} catch (e) {}
/
*
*

  • Component

/
Vue.component('appheader', require('./components/app-header.vue'));
Vue.component('example', require('./components/Example.vue'));
/
*
*

  • Application

*/
Vue.component('branch', require('./module/branch.vue'));
Vue.component('product', require('./module/product.vue'));
Vue.component('category', require('./module/product/category.vue'));
Vue.component('color', require('./module/product/color.vue'));
Vue.component('size', require('./module/product/size.vue'));
Vue.component('category-loop', require('./module/product/category-loop.vue'));
Vue.component('application', require('./module/app.vue'));
Vue.component('dashboard', require('./module/dashboard.vue'));
let App = new Vue({
el: '#app',
data: {
drawer: false,
snackbar: {
status: false,
context: '',
timeout: 6000,
text: ''
},
spinner: true,
mini: false,
right: null,
hidden: true
},
methods: {
toast: function(context='success', text='Action completed', timeout=6000){
this.snackbar = {
status: true,
context: context,
timeout: timeout,
text: text
};
this.$root.loader();
},
loader: function(){
this.spinner = !this.spinner;
}
}
});
jQuery( document ).ready(function() {
App.loader();
});

@mhelaiwa
Copy link

I have the same issue here. I only face this problem when using npm run with the --watch flag.

@Thorazine
Copy link

This is not a jasmine error but a mix or webpack error: laravel-mix/laravel-mix#1084
This worked for me (from page):

mix.options({
	extractVueStyles: true
});

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants