-
Notifications
You must be signed in to change notification settings - Fork 809
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
Uncaught TypeError: utils.isStandardBrowserEnv is not a function #1092
Comments
What does your webpack.mix.js file look like? |
|
I'm getting the same error @davidhoeck - just started recently. Seems to be working fine with watching JS files - but any updates I make to less files require me to stop and run a fresh watch. |
Got the same error after any update in sass files. |
I've gotten this too. I started getting it after I commented out everything in my app.scss files and used a CSS CDN. If I restore everything (uncomment the sass file, take out the CDN) I still get 'Uncaught TypeError: utils.isStandardBrowserEnv is not a function'. This is my laravel mix file
|
Getting the same error every time I update my sass file... |
@JeffreyWay I think it is coming from the axios library... |
Here the same problem when running npm run watch |
+1, only happens on |
Same here... |
@davidhoeck is right that this has something to do with the axios library and it's utils file, but I'm guessing the bug is still somewhere within mix's own Here is a temporary fix: require/import the full axios dist file. All of it's own internal dependencies will be included and webpack/mix won't need to load them. The following works for me and solves this very annoying issue.
|
Mix doesn't have a custom watcher in this case. It's all webpack behind the scenes. I'm having trouble reproducing this. Can someone give me exact steps in a fresh Laravel app to see this error? |
I've narrowed down the problem, and this isn't a problem with laravel-mix per se, but webpack and specifically the watcher - is setting something in a global variable and it is getting overwritten by something else. I was able to reproduce the problem by bringing in First time you run watch, everything is working fine, second time around, the watcher will recompile and // from /node_modules/axios/lib/helpers/isURLSameOrigin.js
'use strict';
var utils = require('./../utils');
module.exports = (
utils.isStandardBrowserEnv() ?
// etc however it is overwritten by From Chrome devtools dumping the utils obj to console: // in /node_modules/css-loader/lib/css-base.js
// import a list of modules into the list
list.i = function(modules, mediaQuery) {
if(typeof modules === "string")
modules = [[null,
// etc I managed to fix it with this ugliness inside the vue-loader : test : /\.vue$/,
loader : 'vue-loader',
options: {
extractCSS: true,
loaders : {
scss: is_prod ? ExtractTextPlugin.extract({use:'css-loader!sass-loader',fallback:'vue-style-loader'}) : 'vue-style-loader!css-loader!sass-loader',
sass: is_prod ? ExtractTextPlugin.extract({use:'css-loader!sass-loader?indentedSyntax',fallback:'vue-style-loader'}) : 'vue-style-loader!sass-loader?indentedSyntax',
css : is_prod ? ExtractTextPlugin.extract({use:'css-loader',fallback:'vue-style-loader'}) : 'vue-style-loader!css-loader',
}, Searching around, it seems to be linked to this : webpack/webpack#5399 |
@wafs Could you be a bit more explicit about your fix (which file..etc.)? Thanks! |
Yeah this doesn't seem to be a Mix-specific issue. It's either directly webpack or the extract plugin. Giving this a close, since there's nothing I can directly do here to fix it. |
I have same error when i update my vue file,how to fix ? Thanks! |
I can confirm that downgrading to |
@bryandease But my webpack version is 3.5, it not match |
I'm also experiencing this problem. @bryandease can you elaborate regarding how you downgraded extract-text-webpack-plugin to resolve it? I'm not quite sure how to override the mess of JS requirements. For instance I installed |
I am using Laravel 5.5 with Bulma CSS (sass) & Vuejs 2. |
Having the same issue at the moment. It's only started happening recently. If I'm using 'npm run watch" and change something in my global scss file and watch as mix recompiles everything, I'll get the above error as soon as I refresh my webpage on my app. IF I happen to open say, one of my vue components and immediately save it (forcing npm watch to do a recompile) everything is fixed again. It's a little annoying but that's what I'm doing at the moment to work around it. |
I managed to recreate it..kinda. Initial conditions:
Steps:
Note:
|
Same issue...I cant use npm watch whilst editing a sass file. As per previous posts, it does appear to be coming from axios. I removed axios from my app and now I can edit sass and watch changes with npm run watch |
Adding |
I have the same issue. It's working fine with npm run dev and npm run hot. |
Same here! |
To me it happens only if I save |
I also experienced this while changing my .scss styles ! |
Just running "npm run watch" and I'm getting the error every 4-5 re-compilations.
Everything is at the newest version
The text was updated successfully, but these errors were encountered: