Sass DevTools wrong path and line - sass

I want to edit sass files for my project using google devtools.
After adding my project from the workspace, I can make live changes.
But..
The source map shows the path to the sass files incorrectly.
as seen in the links.
the selector does not point to the right place.
https://imgur.com/45PSmdB
https://imgur.com/A7Di1Kz
where did I make a mistake?
EDIT:
I solved the problem myself :)
cache and cookies cleared.

Related

WebStorm doesn't compile main SCSS on partial update

I'm building in WebStorm.
I have a main.scss witch references several partial files (names prefixed with _) via #use. I have a file watcher set up and everything works fine when I'm working in the main.scss - I make changes, they get compiled and are reflected in my build.
When I make change in a partial though they don't seem to trigger the file watcher. In order for the changes to show in the build I have to jump back to main.scss and make some small change that triggers the watcher and everything gets compiled. This is a bit of a pain to keep having to do but I've tried messing around with the watcher settings and have had no luck.
Can anyone suggest a way to trigger the file watcher when partial SCSS files are updated?
Thanks
Not a full answer as WebStorm just doesn't seem to want to play ball but in the end I set up webpack and am using the sass-loader which seems to work as desired and actually makes more sense as I'll usually be running webpack anyway.

Live editing SCSS files in Chrome DevTools with Prepros

I just started using Prepros to compile my SCSS files and I can't seem to figure out how to enable live editing of those files in Chrome Developer Tools.
I'm not really sure how this is supported nowadays, but I've found some examples showing this in action (such as this video) and I know it used to be an experimental feature in earlier versions of Chrome.
In Prepros, I have Source Map enabled and the map is showing up in my filesystem properly.
Chrome is also showing all the SCSS files correctly, but I can't save any changes to the file system (basically, whenever I change something, it only changes in the compiled main.css file).
As you can see here, there are no green dots next to the SCSS files:
...and when I try to edit and save them in the Sources panel, this shows up:
Here's my Prepros project structure (everything gets compiled into the main.css file):
Is there any way to set this up so that I could edit anything in DevTools and save it to the file system from there? I want to avoid copying code over to my text editor as much as possible.

DevTools failed to parse SourceMap error after login will redirect to that js file

I am new to VueJS. I am following one of the YouTube tutorial Let's Build a Multi-Purpose Laravel + Vue Application by Code Inspire
This is his github package.
https://github.com/Hujjat/laravStart
I notice. When I logout and login again, it will redirect to .js file.
for my case:-
http://laravel-vuejs.test/js/popper.js.map
and I clone his project. I tried with inspect, I login and logout and login. It will redirect to
http://laravstart.test/js/laravel-vue-pagination.common.js.map
It will show 404 error. I have every time remove the /js/xxxx.js.map then only back to normal.
Both of my project, when I run inspect. I notice have the Chrome warning.
DevTools failed to parse SourceMap: http://laravstart.test/js/laravel-vue-pagination.common.js.map
DevTools failed to parse SourceMap: http://laravel-vuejs.test/js/laravel-js/popper.js.map
IMPORTANT NOTE It only happen when I open the chrome inspect windows. If I close it, it will back to normal means won't redirect to JS file.
Screen record: https://imgur.com/gZzcX5L
I tested with Chrome and Firefox with inspect both having the same problem.
But in Chrome if I off setting for source map, it will not have this issue.
Anyone how to fix it? Compile source map issue? the js.map file not exist.
If you use Laravel Mix, you can generate source maps by calling the mix.sourceMaps() method in your webpack.mix.js file.
This resolves the problem.
mix.js('resources/js/app.js', 'public/js').sourceMaps();
Laravel Mix Source Maps documentation
I found that one solution is created a dummy file at public/js/popper.js.map, then it will back to normal, basically just fulfil what browser developer tool required, it will not redirect to that specific file.
I believe this is browser developer tools behaviour.
I received solution from the laraStart repo owner.
This error happens when you have an error and compile your javascript
code. Later, when you fix it, it will remain in cache and happens.
Please try to compile your script again and login to see.
The solution is also working as well.
I run npm update and npm run dev, it is working fine.
Open "find in files", find every commented line of code that has
sourceMappingURL=...
Delete the whole commented line for each.
There should be 3 entries here in public/app.js and 1 at the end of popper.js.
If you are using Brave shields or an ad blocker, turn it off
The best solution is just copy the popper.js.min from
node_modules
- popper.js
- dist
-> popper.js.min
this solved my headache
There are two SourceMap error in my case so the two previous answers applied to me.
1) By adding sourceMaps() in the mix.js function in webpack.mix.js file
mix.js('resources/js/app.js', 'public/js').sourceMaps();
to remove popper.js source map error.
2) Adding toastr.js.map to public/js folder to remove toastr.js source map error.

How to disable Dev Tools popup to reload externally changed css?

I get this annoying dialog when my SCSS is compiled by sass ruby gem.
How do I disable it?
I solved this simply by removing the folder which contains the compiled assets from Chrome's workspaces. I never quite saw the point of having compiled assets in there anyway, and it gets rid of the dialog.

How to auto-reload css in Chrome after editing SASS files

I am trying to set up the mapping feature in Chrome canary. I followed the screenshots in this answer.
The main feature works, when I inspect an element, it points me to my local sass file and when I edit it, the local file safes, and the `sass --watch' is triggered. However, the browser does not refresh, even though on the "General" tab in devtools I have checked "Auto-reload CSS upon Sass save".
Should the browser reload? Is there a way to get it to reload?
Ps - I have compass but I can not use that as it does not support mapping, so I am compiling sass through the terminal
Thanks
You probably forgot this step:
In the Sources tab, find your generated CSS file, right click on it and choose Map to network resource, and select the same file name in the shown dropdown:
and then choose the matching file from your workspace:
It could be that the Sass-file is still compiling when Chrome tries to reload the CSS. Setting the 'Auto-reload CSS upon Sass save' Timeout to 5000 ms fixed it for me. When Chrome triggers the reload, it can even prevent Sass from recompiling the CSS.
I solved the problem by installing tincr extention and now when I save locally, the browser refreshes.

Resources