Skip to content

Gulp App problem onbuild #1524

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

Closed
FelixCoutinho opened this issue Dec 30, 2015 · 2 comments
Closed

Gulp App problem onbuild #1524

FelixCoutinho opened this issue Dec 30, 2015 · 2 comments

Comments

@FelixCoutinho
Copy link

felix@FLAD-226046:~/git/vmc$ yo angular-fullstack --gulp vmc
...
felix@FLAD-226046:~/git/vmc$ gulp serve

The result is:

Error: Task inject:css is listed more than once. This is probably a typo.

See below:

[13:30:24] Requiring external module babel-core/register
[13:30:24] Using gulpfile ~/git/vmc/gulpfile.babel.js
[13:30:24] Starting 'serve'...
[13:30:24] Starting 'clean:tmp'...
[13:30:24] Starting 'constant'...
[13:30:24] Finished 'constant' after 102 ms
[13:30:24] Finished 'clean:tmp' after 116 ms
[13:30:24] Starting 'lint:scripts'...
[13:30:24] Starting 'lint:scripts:client'...
[13:30:24] Starting 'lint:scripts:server'...
[13:30:24] Starting 'inject'...
[13:30:24] 'inject' errored after 199 μs
[13:30:24] Error: Task inject:css is listed more than once. This is probably a typo.
at /home/felix/git/vmc/node_modules/run-sequence/index.js:24:11
at Array.forEach (native)
at verifyTaskSets (/home/felix/git/vmc/node_modules/run-sequence/index.js:13:11)
at /home/felix/git/vmc/node_modules/run-sequence/index.js:32:4
at Array.forEach (native)
at verifyTaskSets (/home/felix/git/vmc/node_modules/run-sequence/index.js:13:11)
at runSequence (/home/felix/git/vmc/node_modules/run-sequence/index.js:94:2)
at Gulp. (/home/felix/git/vmc/gulpfile.babel.js:148:5)
at module.exports (/home/felix/git/vmc/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:34:7)
at Gulp.Orchestrator._runTask (/home/felix/git/vmc/node_modules/gulp/node_modules/orchestrator/index.js:273:3)
[13:30:24] 'serve' errored after 257 ms
[13:30:24] Error in plugin 'run-sequence'
Message:
An error occured in task 'inject'.
[13:30:24] 'lint:scripts' errored after 141 ms
[13:30:24] Error in plugin 'run-sequence'
Message:
An error occured in task 'serve'.
[13:30:24] 'lint:scripts' errored after 142 ms
[13:30:24] Error in plugin 'run-sequence'
Message:
An error occured in task 'inject'.

client/app/app.constant.js
line 2 col 3 Missing "use strict" statement.
line 2 col 36 Strings must use singlequote.
line 4 col 22 Strings must use singlequote.
line 5 col 16 Strings must use singlequote.
line 6 col 16 Strings must use singlequote.
line 7 col 15 Strings must use singlequote.
line 8 col 16 Strings must use singlequote.

✖ 1 error
⚠ 6 warnings

[13:30:25] Finished 'lint:scripts:client' after 812 ms
[13:30:25] Finished 'lint:scripts:server' after 827 ms

I verify gulpfile.babel.js and tasks inject:css really listed more than once.

gulp.task('inject:css', () => {
    return gulp.src(paths.client.mainView)
        .pipe(plugins.inject(
            gulp.src('/client/**/*.css', {read: false})
                .pipe(plugins.sort()),
            {
                starttag: '<!-- injector:css -->',
                endtag: '<!-- endinjector -->',
                transform: (filepath) => '<link rel="stylesheet" href="' + filepath.replace('/client/', '').replace('/.tmp/', '') + '">'
            }))
        .pipe(gulp.dest('client'));
});

gulp.task('inject:css', () => {
    return gulp.src('client/app/app.css')
        .pipe(plugins.inject(
            gulp.src(_.union(paths.client.styles, ['!' + paths.client.mainStyle]), {read: false})
                .pipe(plugins.sort()),
            {
                starttag: '// injector',
                endtag: '// endinjector',
                transform: (filepath) => {
                    let newPath = filepath
                        .replace('/client/app/', '')
                        .replace('/client/components/', '../components/')
                        .replace(/_(.*).css/, (match, p1, offset, string) => p1)
                        .replace('.css', '');
                    return '@import \'' + newPath + '\';';
                }
            }))
        .pipe(gulp.dest('client/app'));
});
@FelixCoutinho
Copy link
Author

I choose 'CSS' in the stylesheet options during the setup.

@Awk34
Copy link
Member

Awk34 commented Dec 31, 2015

Duplicate of #1504

@Awk34 Awk34 closed this as completed Dec 31, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants