Comments (7)
I had the same problem. U resolve it with this style load configuration.
{ loader: 'css-loader', options: { minimize: true } }, { loader: 'resolve-url-loader' }, { loader: 'sass-loader?sourceMap' }
from ng-universal-demo.
hello
I find a problem when i install the animation module .the give me an error in the browser
ReferenceError: document is not defined
at DefaultDomRenderer2.selectRootElement (C:\Users\nour\Projet\nodeValueSeo\dist\server.js:23817:72)
at createElement (C:\Users\nour\Projet\nodeValueSeo\dist\server.js:10189:23)
at createViewNodes (C:\Users\nour\Projet\nodeValueSeo\dist\server.js:12867:44)
at createRootView (C:\Users\nour\Projet\nodeValueSeo\dist\server.js:12814:5)
at Object.createProdRootView [as createRootView] (C:\Users\nour\Projet\nodeValueSeo\dist\server.js:13475:12)
at ComponentFactory_.create (C:\Users\nour\Projet\nodeValueSeo\dist\server.js:10735:46)
at ComponentFactoryBoundToModule.create (C:\Users\nour\Projet\nodeValueSeo\dist\server.js:4272:29)
at ApplicationRef_.bootstrap (C:\Users\nour\Projet\nodeValueSeo\dist\server.js:5855:57)
at C:\Users\nour\Projet\nodeValueSeo\dist\server.js:5644:79
at Array.forEach (native)
from ng-universal-demo.
@nourissam you need to add BrowserAnimationsModule
in browser-app.module.ts
instead of app.module.ts
, which is used in server.
from ng-universal-demo.
can anybody resolve the issue,
i can resolve it but i dont know why take a long time to build
i used this configuration
`{
test: /.scss$/,
use: [{
loader: "to-string-loader"
}, {
loader: "css-loader"
}, {
loader: "resolve-url-loader"
}, {
loader: "sass-loader", options: {
sourceMap: true,
data: '@import "styles";',
includePaths: [
DIR //const DIR = join(process.cwd(), 'src', 'styles');
]
}
}`
from ng-universal-demo.
@ysus i resolve this problem by creating separate component, where i include my global style and set flag None
to encapsulation
, then i declare this component at my app module file and add selector to app component file.
Example of my component which provide global styles:
@Component({
moduleId: module.id,
selector: 'global-css',
encapsulation: ViewEncapsulation.None,
template: ``,
styleUrls: [
// global styles here
]
})
export class GlobalCssComponent {}
from ng-universal-demo.
But this is a bad practice, break the DOM Shadow
from ng-universal-demo.
I have a solution. I copy some webpack configs from eject version angular-cli-project.
Main changes in webpack/webpack.{commont,client}.js
.
Also you will need update dependencies. My project has angular-cli, so you can use create commands such as ng generate [name]
but ng serve and ng build not work.
See my repo
from ng-universal-demo.
Related Issues (20)
- how to build the file /ngfactory/app/server-app.module.ngfactory HOT 2
- how to add images to pages? HOT 3
- Adding mongoose HOT 3
- aot with universal
- Router resolve with the TransferHttp module
- onBootstrap HOT 1
- How can you access location/url information on the server angular app HOT 3
- Error in starting server HOT 3
- What is the purpose of the TransferHttpModule HOT 8
- Error compiling Scss with npm run build:aot HOT 1
- Problem with assets folder HOT 2
- The server not start HOT 1
- Angular Express Engine service error
- Can't get SASS to work. HOT 1
- Appengine deploy failing HOT 1
- Setting State
- HttpClient HOT 1
- How to make HTTP calls on the server-side inside a lazy loaded module
- security issue with server bundle output
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 ng-universal-demo.