Comments (11)
Oh, weird. Haven't seen this one before. I will look into this and get back to you. Thanks for reporting.
from universal-starter.
@cristinecula are you setting any preboot options? Did you literally just change the option to true and that was it or are there other differences with your code and the latest repo code?
from universal-starter.
@jeffwhelpley this is the output of git diff
diff --git a/src/server.ts b/src/server.ts
index 03d93de..b0fa803 100644
--- a/src/server.ts
+++ b/src/server.ts
@@ -42,7 +42,7 @@ function ngApp(req, res) {
NODE_HTTP_PROVIDERS,
],
async: true,
- preboot: false
+ preboot: true
});
}
(END)
from universal-starter.
@cristinecula can you change the value to preboot: { appRoot: 'app' }
from universal-starter.
@gdi2290 that does the trick :)
Thank you 👍
from universal-starter.
To me it's not working at all.
Cloned repo.
npm install
I change this and only this (it's a fresh install):
preboot: false
TO:
preboot: { appRoot: 'app' }
npm run build
npm start
I open localhost:3000 on Google Chrome Version 50.0.2661.86 (64-bit)
I see the page.
I open dev tools.
Network -> throttle 4G for delay.
Empty Cache & hard reload.
I type some random letters in the "Two-way binding: [this input field]".
"Universal JavaScript ftw!" doesn't change until the page finish to load.
Page finishes to load and "Universal JavaScript ftw!" remains the same while the input field gets reset to default "ftw", I expected the opposite to happen!
What I'm doing wrong?
from universal-starter.
@Kunepro I just tried this out again with the latest and it does work for me. In client.ts
try to change the bootstrap to:
setTimeout(function () {
bootstrap(App, [
...BROWSER_ROUTER_PROVIDERS,
...BROWSER_HTTP_PROVIDERS
]);
}, 3000);
Then test again. This obviously should do the same thing as network throttling, but just curious to see if you see different results. Let me know either way.
from universal-starter.
Hi @jeffwhelpley , nice to meet you, expecially after watching your conferences!
If I load the page from localhost with your code it looks like it works,
I edit the input field, and after the 3 seconds the string gets updated.
However, I hate to bring bad news, but when using developer's tools and network throttling the issue persists. (your code is still there)
I tested this 5 more times to don't come with false results.
Last time I checked that cache is disabled in dev tools setting, and also in dev tools networking tab, plus I deleted all history and caching from chrome.
I open a new tab, open dev tools, throttling to regular 3G, server side page loads instantly, I type some random letters in the input fields, but after the page has loaded the input field is back to "ftw" and also the "Universal JavaScript ftw!" is still like default. :(
My node is: v5.10.1
npm: 3.8.3
I don't think my computer spec may help, however:
OS X El Capitan 10.11.4
debugger:
Type: connect
V8-Version: 5.0.71.35
Protocol-Version: 1
Embedding-Host: node v6.1.0
Content-Length: 0
from universal-starter.
@Kunepro ahhhhh....I see the issue. hey, @gdi2290 so it looks like the express engine is currently pulling in preboot as an external file. We need to make this inline. Let's discuss at our meeting today.
@Kunepro I will post here when we are able to get this change in, but if this is a blocker for you and you are adventurous, the workaround for this is to override the express engine and have the generated preboot code inserted directly into your index.html on the server side. I recommend you wait until we get the fix in, but just wanted to let you know in case you needed a solution ASAP.
from universal-starter.
Hi @jeffwhelpley , thank you for the help.
I'm still working on the client, I can wait the official fix for the server, I'm just glad to know that it will be fixed!
from universal-starter.
Try the latest and let me know.
from universal-starter.
Related Issues (20)
- common error interceptor kills node
- Configure Lazy load for prerender
- Move emitDecoratorMetadata to tsconfig.app.json
- angular.json server configurations should include optimization and sourceMap
- Show how to use multiple environments (for browser and prerender) HOT 4
- Lack of API support in angular universal v7? HOT 2
- How to setup nested router-outlet? HOT 1
- core.js init
- How to avoid re-rendering content inside isPlatformServer in the browser HOT 2
- main.js file in dist incorrectly referenced
- serve prerendered files with an express app instead of http-server
- ERROR ReferenceError: gtag is not defined when running npm run build:prerender HOT 2
- Prerendering Broken HOT 1
- Page rendered both from server and browser HOT 1
- get data from any server php
- Is there any way of doing a post request WITHOUT javascript ?
- How deploy Angular Universal with Azure CDN?
- Cannot find module @angular/core
- bug in docs v6 angular @NgModule?
- bug in docs v6 angular --app
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from universal-starter.