angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

deprication notice while build: Node#moveTo was deprecated. Use Container#append.

Open sibiraj-s opened this issue 9 years ago • 31 comments

Version


    _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/
    
Angular CLI: 1.5.3
Node: 8.9.1
OS: linux x64
Angular: 5.0.0
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 1.5.3
@angular/tsc-wrapped: 4.4.6
@angular-devkit/build-optimizer: 0.0.32
@angular-devkit/core: 0.0.20
@angular-devkit/schematics: 0.0.35
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.8.3
@schematics/angular: 0.1.0
typescript: 2.4.2
webpack: 3.8.1

Observed behavior

30% building modules 167/168 modules 1 active ...nts/src/styles.scssNode#moveTo was deprecated. Use Container#append.

After updating to 1.5.3 I get this notice with scss while running ng build --prod

sibiraj-s avatar Nov 22 '17 17:11 sibiraj-s

Heya, I tried this on a new project with this src/styles.scss:

body {
  background-color: #000000
}

But couldn't see that message.

This seems like a bug but we'll need to look at a reproduction to find and fix the problem. Can you setup a minimal repro please?

You can read here why this is needed. A good way to make a minimal repro is to create a new app via ng new repro-app and adding the minimum possible code to show the problem. Then you can push this repository to github and link it here.

I guess it's related to some dependency update but there might be more to it.

filipesilva avatar Nov 23 '17 12:11 filipesilva

This is coming from cssnano. It still uses some deprecated methods. The methods still function and the warning will only be shown at most once. The next version of cssnano (when released) should completely resolve the issue.

clydin avatar Nov 23 '17 13:11 clydin

Can you setup a minimal repro please?

sure @filipesilva.

sibiraj-s avatar Nov 23 '17 14:11 sibiraj-s

@filipesilva .

Steps to Reproduce.

This is what I did. I set default stylesheets to scss

  1. ng new myApp
  2. npm install bootstrap@next
  3. import bootstrap.scss into style.scss
/* You can add global styles to this file, and also import other style files */

@import "../node_modules/bootstrap/scss/bootstrap"; // I used bootstrap

  1. ng build -- prod

The problem occurs while importing files into styles.scss

myApp.zip

sibiraj-s avatar Nov 23 '17 19:11 sibiraj-s

Some issue when trying to import normalize.css.

Same setup. SCSS, @import, etc.

gpit2286 avatar Nov 29 '17 06:11 gpit2286

Same issue here after migration to 1.6.0: Build stderr: Node#moveTo was deprecated. Use Container#append.

"styles": [
        "path-to-bootstrap4-sass-here"
      ],

Looks like first version that has this error is 1.5.3 and it throws this error only in --prod mode.

dragonflypl avatar Dec 08 '17 13:12 dragonflypl

I have same trouble with bootstrap 4 file _normalize.scss for rule:

b,
strong {
  font-weight: inherit;
}

image

but without b all is fine: image

Dok11 avatar Jan 03 '18 14:01 Dok11

Same problem, cli 1.6.3

skorunka avatar Jan 07 '18 09:01 skorunka

I'm having problems with this too and it's causing TeamCity builds to fail that are otherwise clean. I haven't found a good workaround for this, but the real problem is non-error messages being sent to STDERR. When we will have the ability to filter non-error messages? Even better would be to stop sending everything to the wrong output. Not sure how this behavior is acceptable...

fusionx86 avatar Jan 08 '18 20:01 fusionx86

Most likely the node.js deprecate method in the util method is being used - this is documented to write to STDERR: https://nodejs.org/api/util.html#util_util_deprecate_function_string

johnlacr avatar Jan 09 '18 15:01 johnlacr

same problem with cli 1.6.6

polyglotinc avatar Jan 28 '18 15:01 polyglotinc

This one is getting frustrating on our TFS/MSBuild chains because it throws a "partial success" (or partial fail, depending on your viewpoint), which makes it look like our build is faulty. I've tried using variations on the --no-deprecation flag for Node, but no way of launching my scripts seems to make that flag work to hide the deprecation alert. I've even tried editing an ejected webpack.config.js file to include a process.noDeprecation = true; line, but that doesn't work either. Is there no way to get around the spurious deprecation warning until 1.7.0 comes out someday?

Londovir avatar Jan 29 '18 14:01 Londovir

I'm experiencing the same problem, spent an hour to try and silence this on our build server with no luck. cli v1.6.5. I don't see it on cli 1.7.0 beta 2, but ng serve still crashes our application, so can't use it on dev environment. If it doesn't appear on 1.7, would be nice to have the fix on 1.6.7

ubarevicius avatar Jan 29 '18 14:01 ubarevicius

so which version of angular/cli does work for angular 5 ng build --prod ?

denny89k avatar Jan 29 '18 16:01 denny89k

Angular 4

I am having this problem only with ng build --prod also

@Londovir Concerning TFS build definitions, I had to toggle ContinueOnError option under control options inside the task. Downside to this, it will continue on ANY error though it will be recorded in the logs that it had errors. I would think you run your application locally first before deploying, so build commands shouldn't usually have a problem. This is only a bandaid and like all injuries if you bleed a lot 1 bandaid wont be enough ref: msdn

imgregduh avatar Jan 31 '18 01:01 imgregduh

1.7.0-beta.3 release of the cli works fine for us, the error is gone and now it doesn't crash anymore at runtime while serving aot compiled websites.

ubarevicius avatar Feb 01 '18 08:02 ubarevicius

I may have to hold until 1.7.0 launches officially. Our team usually uses CLI in an ejected format, since we have custom tooling we need to add to the build chain, so in cases like this I'll need to use the CLI to create a shell project, eject it so I can see how they've changed the base webpack config files (likely removing cssnano since I believe that is the source of the deprecated "error"), and then update our customized webpack configs as needed.

Londovir avatar Feb 01 '18 16:02 Londovir

I'have the same issue

"@angular/cli": "1.6.6", "bootstrap": "~4.0.0",

Version of node: 8.9.4

ng build --prod rc\assets\styles\style.scssNode#moveTo was Date: 2018-02-02T07:52:15.646Z 45% building modules 296/297 modules 1 active ...s\WebSpa\src\assets\styles\style.scssNode#moveTo was Date: 2018-02-02T07:52:15.646Z

jfernandeze avatar Feb 02 '18 08:02 jfernandeze

Hi everyone, I had the same problem with cli 1.6.7, is there any update how to fix this?

thovo avatar Feb 08 '18 13:02 thovo

Same here with cli 1.6.8 running on node 9.4.0

Baklap4 avatar Feb 14 '18 10:02 Baklap4