EXAMPLE QUESTION for #steemdevqna | Elixir Laravel SyntaxError: Unexpected token

in #steemdevqna7 years ago

I made some changes to my gulpfile.js. Then I received the following syntax error in my terminal after executing the gulp command:

'version' errored after 657 μs
     SyntaxError: Unexpected token }
        at Object.parse (native)
        at VersionTask.deleteManifestFiles (/var/www/html/work/node_modules/laravel-elixir/dist/tasks/VersionTask.js:114:29)
        at VersionTask.gulpTask (/var/www/html/work/node_modules/laravel-elixir/dist/tasks/VersionTask.js:72:18)
        at VersionTask.run (/var/www/html/work/node_modules/laravel-elixir/dist/tasks/Task.js:139:31)
        at /var/www/html/work/node_modules/laravel-elixir/dist/tasks/GulpBuilder.js:60:37
        at Array.forEach (native)
        at Gulp.(/var/www/html/work/node_modules/laravel-elixir/dist/tasks/GulpBuilder.js:59:54)
        at module.exports (/var/www/html/work/node_modules/orchestrator/lib/runTask.js:34:7)
        at Gulp.Orchestrator._runTask (/var/www/html/work/node_modules/orchestrator/index.js:273:3)
        at Gulp.Orchestrator._runStep (/var/www/html/work/node_modules/orchestrator/index.js:214:10)

Looking in my public/build/css directory I noticed all my css versions are incorrect.


My gulpfile.js file:

const elixir = require('laravel-elixir');

require('laravel-elixir-vue');

elixir(mix => {
// for the application, after login
mix.sass(['styles.scss','imports.scss'])
.version(['css/styles.css','css/imports.css']);
});

How can further debug or fix this `gulp` error?
Sort:  

After opening the rev-manifest.json file in the public/build/ directory, I discovered it was somehow missing css/imports-xxxxxxx.css in the json list. I deleted rev-manifest.json and entered the command gulp. Now after opening rev-manifest.json all the css files are listed and the error is gone.

This post received a 1.9% upvote from @randowhale thanks to @finkavenue! For more information, click here!

This post received a 3.2% upvote from @randowhale thanks to @finkavenue! For more information, click here!

This post has received a 2.20 % upvote from @booster thanks to: @finkavenue.