enten / udk Goto Github PK
View Code? Open in Web Editor NEWUniversal Development Kit: Webpack extension which improves universal application development. - THE UDK PROJECT SUPPORT IS CURRENTLY SUSPENDED.
License: MIT License
Universal Development Kit: Webpack extension which improves universal application development. - THE UDK PROJECT SUPPORT IS CURRENTLY SUSPENDED.
License: MIT License
When I build the project using the latest of angular, devkit and cli I get this error:
An error occurred during write index:
Error: EISDIR: illegal operation on a directory, open '/home/qdouble/playground/angular-universal/dist/app/browser'
at Object.openSync (fs.js:443:3)
at Object.writeFileSync (fs.js:1194:35)
at Observable.rxjs_1.Observable.obs [as _subscribe] (/home/qdouble/playground/angular-universal/node_modules/@angular-devkit/core/node/host.js:176:20)
at Observable._trySubscribe (/home/qdouble/playground/angular-universal/node_modules/@angular-devkit/core/node_modules/rxjs/internal/Observable.js:44:25)
at Observable.subscribe (/home/qdouble/playground/angular-universal/node_modules/@angular-devkit/core/node_modules/rxjs/internal/Observable.js:30:22)
at /home/qdouble/playground/angular-universal/node_modules/@angular-devkit/build-angular/node_modules/rxjs/internal/util/subscribeToObservable.js:10:20
at Object.subscribeToResult (/home/qdouble/playground/angular-universal/node_modules/@angular-devkit/build-angular/node_modules/rxjs/internal/util/subscribeToResult.js:10:45)
at SwitchMapSubscriber._innerSub (/home/qdouble/playground/angular-universal/node_modules/@angular-devkit/build-angular/node_modules/rxjs/internal/operators/switchMap.js:65:54)
at SwitchMapSubscriber._next (/home/qdouble/playground/angular-universal/node_modules/@angular-devkit/build-angular/node_modules/rxjs/internal/operators/switchMap.js:55:14)
at SwitchMapSubscriber.Subscriber.next (/home/qdouble/playground/angular-universal/node_modules/@angular-devkit/build-angular/node_modules/rxjs/internal/Subscriber.js:66:18)
at SafeSubscriber.__tryOrUnsub (/home/qdouble/playground/angular-universal/node_modules/@angular-devkit/core/node_modules/rxjs/internal/Subscriber.js:207:16)
at SafeSubscriber.next (/home/qdouble/playground/angular-universal/node_modules/@angular-devkit/core/node_modules/rxjs/internal/Subscriber.js:145:22)
at Subscriber._next (/home/qdouble/playground/angular-universal/node_modules/@angular-devkit/core/node_modules/rxjs/internal/Subscriber.js:89:26)
at Subscriber.next (/home/qdouble/playground/angular-universal/node_modules/@angular-devkit/core/node_modules/rxjs/internal/Subscriber.js:66:18)
at SafeSubscriber.__tryOrUnsub (/home/qdouble/playground/angular-universal/node_modules/@angular-devkit/build-angular/node_modules/rxjs/internal/Subscriber.js:207:16)
at SafeSubscriber.next (/home/qdouble/playground/angular-universal/node_modules/@angular-devkit/build-angular/node_modules/rxjs/internal/Subscriber.js:145:22)
It does it on my main project and I tried it on your angular-universal starter above. If I downgrade the packages to 8.1.3 it builds just fine.
Compiler.prototype.compile
instead of hook compiler stage--require
to allow loaders (like ts-node/register
)Issue reproduces only on Windows. Lunix and Mac OS works fine.
Trying to build project from https://github.com/Stivin/angular-universal
Result:
ERROR in /C/Source/angular-universal/src/app/shared/layout/toolbar/toolbar-lang/toolbar-lang.component.ts
Module not found: Error: Can't resolve '../../../translate' in '/C/Source/angular-universal/src/app/shared/layout/toolbar/toolbar-lang'
Broken line:
import { TranslateService } from './translate';
Works fine:
import { TranslateService } from './translate/index';
or
import {TranslateService} from './translate/translate.service';
Can you please have a look?
Sumbitting issue here because I got no errors when building via ng cli commands.
Hello, I'm looking to use the latest release, but only 1.1.0-rc.0 is on npm
After upgrading from Angular 7.1.x to the just released 7.2 the build with UDK fails throwing the following exception:
normalizeFileReplacements(...).pipe is not a function
TypeError: normalizeFileReplacements(...).pipe is not a function
at supportFileReplacement (/Users/heb/devel/my-project/node_modules/udk/angular/lib/udk-builder.js:32:68)
at MergeMapSubscriber._getBuilderConfig.pipe.operators_1.concatMap [as project] (/Users/heb/devel/my-project/node_modules/udk/angular/lib/udk-builder.js:175:41)
at MergeMapSubscriber._tryNext (/Users/heb/devel/my-project/node_modules/rxjs/internal/operators/mergeMap.js:69:27)
at MergeMapSubscriber._next (/Users/heb/devel/my-project/node_modules/rxjs/internal/operators/mergeMap.js:59:18)
at MergeMapSubscriber.Subscriber.next (/Users/heb/devel/my-project/node_modules/rxjs/internal/Subscriber.js:67:18)
at MergeMapSubscriber.notifyNext (/Users/heb/devel/my-project/node_modules/rxjs/internal/operators/mergeMap.js:92:26)
at InnerSubscriber._next (/Users/heb/devel/my-project/node_modules/rxjs/internal/InnerSubscriber.js:28:21)
at InnerSubscriber.Subscriber.next (/Users/heb/devel/my-project/node_modules/rxjs/internal/Subscriber.js:67:18)
at /Users/heb/devel/my-project/node_modules/rxjs/internal/util/subscribeTo.js:17:28
at Object.subscribeToResult (/Users/heb/devel/my-project/node_modules/rxjs/internal/util/subscribeToResult.js:10:45)
at MergeMapSubscriber._innerSub (/Users/heb/devel/my-project/node_modules/rxjs/internal/operators/mergeMap.js:82:29)
at MergeMapSubscriber._tryNext (/Users/heb/devel/my-project/node_modules/rxjs/internal/operators/mergeMap.js:76:14)
at MergeMapSubscriber._next (/Users/heb/devel/my-project/node_modules/rxjs/internal/operators/mergeMap.js:59:18)
at MergeMapSubscriber.Subscriber.next (/Users/heb/devel/my-project/node_modules/rxjs/internal/Subscriber.js:67:18)
at MergeMapSubscriber.notifyNext (/Users/heb/devel/my-project/node_modules/rxjs/internal/operators/mergeMap.js:92:26)
at InnerSubscriber._next (/Users/heb/devel/my-project/node_modules/rxjs/internal/InnerSubscriber.js:28:21)
at InnerSubscriber.Subscriber.next (/Users/heb/devel/my-project/node_modules/rxjs/internal/Subscriber.js:67:18)
at MapSubscriber._next (/Users/heb/devel/my-project/node_modules/rxjs/internal/operators/map.js:55:26)
at MapSubscriber.Subscriber.next (/Users/heb/devel/my-project/node_modules/rxjs/internal/Subscriber.js:67:18)
at MergeMapSubscriber.notifyNext (/Users/heb/devel/my-project/node_modules/rxjs/internal/operators/mergeMap.js:92:26)
at InnerSubscriber._next (/Users/heb/devel/my-project/node_modules/rxjs/internal/InnerSubscriber.js:28:21)
at InnerSubscriber.Subscriber.next (/Users/heb/devel/my-project/node_modules/rxjs/internal/Subscriber.js:67:18)
In lib/util/WatchpackFork.js, the method close() used the package killer to kill the child process.
On Windows, the callback passed to killer is called more than once: that is a source of bugs.
// udk/lib/util/WatchpackFork
// 0d5d7da on 19 Oct 2017@enten
const Watchpack2 = require('./Watchpack2')
const childProcess = require('child_process')
const killer = require('killer')
class WatchpackFork extends Watchpack2 {
// ...
close (callback) {
const done = () => {
this.child = undefined
callback && callback()
}
return super.close(() => {
if (!this.child) {
return done()
}
killer(this.child.pid, done)
})
}
// ...
}
For example, in lib/util/container.js, the method runContainer() call the method closeContainer() when the container has already a watcher (if the container is already forked): that method is called with a callback which will be called by WatchpackFork.close() when the fork process will be killed. That callback will restart the container: if it called more than once, each called will potentially starts a new fork process.
Temporary fix: we can ensure that the callback is called only once.
close (callback) {
let doneCalled = false // +++
const done = () => {
if (doneCalled) { // +++
return // +++
} // +++
doneCalled = true // +++
this.child = undefined
callback && callback()
}
return super.close(() => {
if (!this.child) {
return done()
}
killer(this.child.pid, done)
})
}
Better fix: understand why killer called the callback twice under Windows and fix it.
TODO
(webpack-command is officially deprecated)
If I build the browser and server separately, the css gets extracted just fine, but when I build with udk, while it seems to work fine with the dev server, the css doesn't get put into the head tag when doing a regular build.
Using:
"@angular-devkit/build-angular": "~0.801.0",
"@angular/cli": "~8.1.0",
"udk": "^1.1.4",
Source of the issue : lib/MultiCompiler.js
HMR on server side is broken for webpack4 when the server bundle hot reload a file which was already hot reloaded by a bundle dependency.
The event which hold hot updates is lost during waiting time.
Server Bundle ---> Shared Module <-- Client Bundle
| ^
+------------------------------------+
udk:client:cpl null invalid +3s
webpack building...
udk:server:cpl null invalid +3s
webpack building...
udk:client:cpl 8 watchRun +204ms
udk:client:cpl 9 normalModuleFactory +1ms
udk:client:cpl 10 contextModuleFactory +1ms
udk:client:cpl 11 beforeCompile +0ms
udk:client:cpl 12 compile +0ms
udk:client:cpl 13 thisCompilation +1ms
udk:client:cpl 14 compilation +1ms
udk:client:cpl 15 make +2ms
udk:server:cpl 8 watchRun +213ms
udk:server:cpl wait for compiler 'client' +0ms
udk:client:cpl 16 afterCompile +23ms
udk:client:cpl 17 shouldEmit +0ms
udk:client:cpl 19 emit +0ms
udk:client:cpl 20 afterEmit +2ms
udk:ctnr:fork update client stats +3s
udk:client:cpl 21 done +3ms
udk:server:cpl waiting ended for compiler 'client' +25ms
udk:client:cpl invalid compiler 'server' due to change { fileName: '/home/steven/code/udk/examples/basic/src/shared.js', changeTime: 1522507183373 } +1ms
udk:server:cpl null invalid +0ms
webpack building...
udk:ctnr:fork compiler watching +4ms
udk:server:cpl 9 normalModuleFactory +6ms
udk:server:cpl 10 contextModuleFactory +0ms
udk:server:cpl 11 beforeCompile +0ms
udk:server:cpl 12 compile +1ms
udk:server:cpl 13 thisCompilation +0ms
udk:server:cpl 14 compilation +1ms
udk:server:cpl 15 make +0ms
udk:server:cpl 16 afterCompile +13ms
udk:server:cpl 8 watchRun +0ms
udk:server:cpl 9 normalModuleFactory +1ms
udk:server:cpl 10 contextModuleFactory +0ms
udk:server:cpl 11 beforeCompile +0ms
udk:server:cpl 12 compile +0ms
udk:server:cpl 13 thisCompilation +0ms
udk:server:cpl 14 compilation +1ms
udk:server:cpl 15 make +0ms
udk:server:cpl 16 afterCompile +7ms
udk:server:cpl 17 shouldEmit +0ms
udk:server:cpl 19 emit +0ms
udk:server:cpl 20 afterEmit +2ms
udk:server:cpl 21 done +1ms
webpack built client e923e801f199865a2b0b in 31ms
webpack built server f920487f814020a1421a in 12ms
udk:ctnr:fork compiler watching +37ms
I do not see that it's starting a server of any kind, how would the setup look like to enable HMR on browser client?
With udk-builder, when fileLoaderEmitFile
is false:
background-image: url(./foo.png')
) are emitted ;Fix: override postcssPluginCreator
from angular webpack model for styles in buildServerWebpackConfig to use server version of PostcssCliResources to avoid extracts file from css.
When running ng serve
, I got:
Unknown option: '--source-map'
After a few minutes of Googling, I have tried an another approach with changes of angular.json
as below:
...
{
"serve": {
"builder": "udk:udk-runner",
"options": {
"sourceMap": {
"scripts": false,
"styles": false
}
},
"configurations": {}
}
}
...
When running ng serve
, I got these following errors:
Schema validation failed with the following errors:
Data path "" should NOT have additional properties(sourceMap).
When updating to @next version angular, I'm getting the following error: An unhandled exception occurred: Cannot read property 'assertCompatibleAngularVersion' of undefined
The CLI outputs this error log:
[error] TypeError: Cannot read property 'assertCompatibleAngularVersion' of undefined
at buildUniversal (/home/marketstripe/Sites/polysolo-workspace/node_modules/udk/angular/lib/udk-builder.js:25:25)
at onInput (/home/marketstripe/Sites/polysolo-workspace/node_modules/@angular-devkit/architect/src/create-builder.js:145:30)
at SafeSubscriber.context.inboundBus.subscribe.i [as _next] (/home/marketstripe/Sites/polysolo-workspace/node_modules/@angular-devkit/architect/src/create-builder.js:63:29)
at SafeSubscriber.__tryOrUnsub (/home/marketstripe/Sites/polysolo-workspace/node_modules/@angular/cli/node_modules/rxjs/internal/Subscriber.js:207:16)
at SafeSubscriber.next (/home/marketstripe/Sites/polysolo-workspace/node_modules/@angular/cli/node_modules/rxjs/internal/Subscriber.js:145:22)
at Subscriber._next (/home/marketstripe/Sites/polysolo-workspace/node_modules/@angular/cli/node_modules/rxjs/internal/Subscriber.js:89:26)
at Subscriber.next (/home/marketstripe/Sites/polysolo-workspace/node_modules/@angular/cli/node_modules/rxjs/internal/Subscriber.js:66:18)
at Object.next (/home/marketstripe/Sites/polysolo-workspace/node_modules/@angular/cli/node_modules/rxjs/internal/observable/onErrorResumeNext.js:22:49)
at SafeSubscriber.__tryOrUnsub (/home/marketstripe/Sites/polysolo-workspace/node_modules/@angular/cli/node_modules/rxjs/internal/Subscriber.js:207:16)
at SafeSubscriber.next (/home/marketstripe/Sites/polysolo-workspace/node_modules/@angular/cli/node_modules/rxjs/internal/Subscriber.js:145:22)
at Subscriber._next (/home/marketstripe/Sites/polysolo-workspace/node_modules/@angular/cli/node_modules/rxjs/internal/Subscriber.js:89:26)
at Subscriber.next (/home/marketstripe/Sites/polysolo-workspace/node_modules/@angular/cli/node_modules/rxjs/internal/Subscriber.js:66:18)
at ReplaySubject.Subject.next (/home/marketstripe/Sites/polysolo-workspace/node_modules/@angular/cli/node_modules/rxjs/internal/Subject.js:60:25)
at ReplaySubject.nextInfiniteTimeWindow (/home/marketstripe/Sites/polysolo-workspace/node_modules/@angular/cli/node_modules/rxjs/internal/ReplaySubject.js:48:31)
at Object.next (/home/marketstripe/Sites/polysolo-workspace/node_modules/@angular/cli/node_modules/rxjs/internal/operators/shareReplay.js:33:50)
at SafeSubscriber.__tryOrUnsub (/home/marketstripe/Sites/polysolo-workspace/node_modules/@angular/cli/node_modules/rxjs/internal/Subscriber.js:207:16)
So Version is coming up undefined here:
udk/angular/lib/udk-builder.ts
Line 73 in 0f84107
you can use https://github.com/patrickhousley/nest-angular-universal to test.
Hey...I tried to see if I can start working with Angular 9 now that it is in rc, but udk doesn't work with it. Any plans to make it compatible soon?
Hi, do you have an idea of supporting Node 10/11? Package fails to install on Node 10 since you have engines defined in package.json
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.