Giter VIP home page Giter VIP logo

Comments (7)

DmitriyKhirniy avatar DmitriyKhirniy commented on May 30, 2024

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.

nourissam avatar nourissam commented on May 30, 2024

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.

rimlin avatar rimlin commented on May 30, 2024

@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.

ysus avatar ysus commented on May 30, 2024

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.

rimlin avatar rimlin commented on May 30, 2024

@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.

ysus avatar ysus commented on May 30, 2024

But this is a bad practice, break the DOM Shadow

from ng-universal-demo.

Maden-maxi avatar Maden-maxi commented on May 30, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.