-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Gulp build failed. #2039
Comments
@dylannnn let me release a new beta version... hold on.. |
4.0.0-beta.4 has been pushed to npm |
Hi Awk34, That's great!!! But, I got some other small errors, which I can fix it manually: But still, I'm keeping get this ERROR (every time when I run "gulp build"): ... stream.js:74 I've no idea how to fix this. Tried: declare module "jquery" { But still not works, because when I run build, those will change back automatically. Thanks for your effort! Let's make a better Angular-Fullstack! |
@dylannnn what about just removing the jQuery dependency? I don't believe the generator needs jQuery out-of-the-box, since Angular provides JQLite itself. |
@Awk34, I tried to remove the jQuery library from typings.json, and the typings/main.d.ts, typings/browser.d.ts, and remove jquery folder from typings/main/ambient and typings/browser/ambient, then, I run "gulp build", I got the error as below: stream.js:74
throw er; // Unhandled stream error in pipe.
^
Error: [default] C:/Users/Yunfei/www/triple/typings/browser/ambient/angular/index.d.ts:65:42
Cannot find name 'JQuery'.[default] C:/Users/Yunfei/www/triple/typings/browser/ambient/angular/index.d.ts:986:42
Cannot find name 'JQuery'.[default] C:/Users/Yunfei/www/triple/typings/browser/ambient/angular/index.d.ts:1205:18
Cannot find name 'JQuery'.[default] C:/Users/Yunfei/www/triple/typings/browser/ambient/angular/index.d.ts:1230:25
Cannot find name 'JQuery'.[default] C:/Users/Yunfei/www/triple/typings/browser/ambient/angular/index.d.ts:1827:45
Cannot find name 'JQueryStatic'.[default] C:/Users/Yunfei/www/triple/typings/browser/ambient/angular/index.d.ts:1832:17
Cannot find name 'JQuery'.[default] C:/Users/Yunfei/www/triple/typings/browser/ambient/angular/index.d.ts:1838:39
Cannot find name 'JQuery'.[default] C:/Users/Yunfei/www/triple/typings/browser/ambient/angular/index.d.ts:1844:18
Cannot find name 'JQuery'.[default] C:/Users/Yunfei/www/triple/typings/browser/ambient/angular/index.d.ts:1856:48
Cannot find name 'JQuery'.[default] C:/Users/Yunfei/www/triple/typings/browser/ambient/angular/index.d.ts:1857:53
Cannot find name 'JQuery'. angular does need it? Let me do more research on "Typings". Thanks. |
I believe it's protractor and jquery both having the Think it should be fine to remove both explicit jquery dependency and its typings. @dylannnn Angular does not explicitly need JQuery but unsure how the typings for it has been written. Will look into it. |
ugh damn, why do the Angular typings also require JQuery typings.... at it's worst, you'll just have that typings error, which I guess you can ignore.. |
Yeah the Angular typings really do depend on JQuery: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/angularjs/angular.d.ts#L7. This is just a type error so should be able to just ignore it imo. |
I think I know why I can't build. I checked the "gulpfile.babel.js", in the "gulp serve" task, this [ to [ and now I can build successfully. But I can still see the error in the command line, which I can ignore. Best, |
@dylannnn I don't see why you'd comment out |
Build seems broken on canary. Getting:
The resulting dist folder contains all of the server files but none of the client js|css|html files. Only Looking into it now, the webpack build did work a while ago so just have to work out what broke it. Only thing I can see from the output now is that the task @Awk34 Any idea what could have broken the build or how to get the errors to be more verbose? Going with the assumption that it's some change to the webpack file Configuration:
|
Going back to an earlier version of the webpack file did not change anything. Looking into changes in the gulp script now. Using commit c85dac2 (16 days ago) as a reference as I know for sure that it worked back then. |
Only changes to remove bower files and the constant task. Along with lazy-loading webpack config and css task changes. Tried reverting the latter two but still no changes. Also tried updating the dependencies of the earlier working project to verify that it's not one of those updates that are not working. |
Commenting out Specifically changed the webpack:dist task by adding an on error function as follows: gulp.task('webpack:dist', function() {
const webpackDistConfig = makeWebpackConfig({ BUILD: true });
return gulp.src(webpackDistConfig.entry.app)
.pipe(webpack(webpackDistConfig))
.on('error', function handleError(err) {
console.log('start of errors in webpack');
console.log(err);
console.log('end of errors in webpack');
this.emit('end'); // Recover from errors
})
.pipe(gulp.dest(`${paths.dist}/client`));
}); As seen from the output below it seems like the error caught is simply the type error that currently exists. So a more permanent fix seems to be to avoid having such type errors register as errors. Given that there are more serious errors that we wish to catch and prevent from being built. Though I am unsure how they've come to start being registered as such to begin with. ...
[19:23:38] Starting 'webpack:dist'...
[19:23:39] Finished 'copy:server' after 565 ms
[19:23:40] Finished 'copy:extras' after 1.82 s
[19:23:41] Finished 'copy:fonts:dist' after 2.94 s
[19:23:41] Finished 'copy:assets' after 3.01 s
start of errors in webpack
{ [Error: [default] /home/adam/apps/gen-tmps/4.0.0-beta/def-build4/typings/browser/ambient/jquery/index.d.ts:3192:12
Subsequent variable declarations must have the same type. Variable '$' must be of type 'cssSelectorHelper', but here has type 'JQueryStatic'.]
message: '[default] /home/adam/apps/gen-tmps/4.0.0-beta/def-build4/typings/browser/ambient/jquery/index.d.ts:3192:12 \nSubsequent variable declarations must have the same type. Variable \'$\' must be of type \'cssSelectorHelper\', but here has type \'JQueryStatic\'.',
showStack: false,
showProperties: true,
plugin: 'webpack-stream',
__safety: { toString: [Function: bound ] } }
end of errors in webpack
[19:23:54] Version: webpack 1.13.1
Asset Size Chunks Chunk Names
app.71a217d033ed77859e03.js 283 kB 0 [emitted] app
polyfills.71a217d033ed77859e03.js 136 kB 1 [emitted] polyfills
vendor.71a217d033ed77859e03.js 721 kB 2 [emitted] vendor
app.71a217d033ed77859e03.js.map 945 kB 0 [emitted] app
polyfills.71a217d033ed77859e03.js.map 584 kB 1 [emitted] polyfills
vendor.71a217d033ed77859e03.js.map 5.6 MB 2 [emitted] vendor
../client/index.html 1.43 kB [emitted]
ERROR in [default] /home/adam/apps/gen-tmps/4.0.0-beta/def-build4/typings/browser/ambient/jquery/index.d.ts:3192:12
Subsequent variable declarations must have the same type. Variable '$' must be of type 'cssSelectorHelper', but here has type 'JQueryStatic'.
Child html-webpack-plugin for "../client/index.html":
[19:23:54] Finished 'webpack:dist' after 15 s
[19:23:54] Starting 'revReplaceWebpack'...
[19:23:54] Finished 'revReplaceWebpack' after 11 ms
[19:23:54] Finished 'build' after 18 s |
@Koslun does Edit: Well, it does look like TS is emitting, and subsequently Webpack is emitting. Hmm. |
@Awk34 Setting I am also curious what it was that somehow caused TS errors to suddenly become emitted through Webpack to Gulp. Slightly related news, looks like v2 of awesome-typescript-loader launched today and that it will be exclusively supporting webpack 2 and typescript 2. Which both seem pretty done, webpack in particular only having some bug fixes left but with a severe lack of documentation. Gulp 4 additionally seems extremely close to launch, the issues they are waiting on might be fixed by this weekend. So thinking the documentation and plugins might be ready by the time we have Angular 2 support somewhat supported. |
I tried to comment:
because this two tasks are not exist.
Then I got the error:
Subsequent variable declarations must have the same type. Variable '$' must be of type 'cssSelectorHelper', but here has type 'JQueryStatic'.
I don't know how to fix it. I searched online, vladimir-ivanov commened on angular/angular#4725 with a solution:
but every time when I run gulp command, it will reset back.
Any ideas?
The text was updated successfully, but these errors were encountered: