Meteor v3.1, provide node options

After upgraded my app to 3.1, I have this warning:

(node:1225965) Warning: The `util._extend` API is deprecated. Please use Object.assign() instead.
(Use `node --trace-warnings ...` to show where the warning was created)

I tried to add --trace-warnings option by following this post: [solved] How to provide NODE_OPTIONS in 2.3.5? - #2 by robfallows
But I got the same warning.

Any suggestion? Thank you.

I see that too so I’d say it is V3.1 thing

To add nodejs configuration flags, you need to use environment variables, as you have found out.

One or two things may make this not work as you expect:

  1. For some (all?) flags, when sent via an environment, dashes must be replaced with underscore. An example is --max-old-space-size. This can only be set as max_old_space_size so this could be true also for --trace-warnings: Set trace_warnings instead (with an underscore). Edit: this seems to be only for V8 options so should not apply here

  2. If the warning comes from the meteor build phase (as opposed to when your app is running), you must use the TOOL_NODE_FLAGS environment variable instead.

Here are the options we use in a .circleci/config file to add more memory during test runs but much more for building (since Typescript gobbles up so much memory).

        NODE_OPTIONS: --max_old_space_size=5700
        # https://github.com/jshimko/meteor-launchpad/issues/41
        TOOL_NODE_FLAGS: --max_old_space_size=14000
1 Like

You’re right. trace-warnings flag works when I use TOOL_NODE_FLAGS env.

TOOL_NODE_FLAGS=--trace-warnings
(node:2181344) Warning: The `util._extend` API is deprecated. Please use Object.assign() instead.
    at node:internal/util:116:11
    at deprecated (node:internal/util:163:7)
    at ProxyServer.<anonymous> (/home/minhna/.meteor/packages/meteor-tool/.3.1.0.irpbm0.oxkl++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/http-proxy/lib/http-proxy/index.js:50:26)
    at /tools/runners/run-proxy.js:214:41
    at attempt (/tools/runners/run-proxy.js:194:16)
    at Proxy._tryHandleConnections (/tools/runners/run-proxy.js:214:9)
    at Server.<anonymous> (/tools/runners/run-proxy.js:56:12)
    at Server.emit (node:events:518:28)
    at parserOnIncoming (node:_http_server:1150:12)
    at HTTPParser.parserOnHeadersComplete (node:_http_common:117:17)

I’m glad it worked. The warning indicates that there’s an old version of http-proxy in meteor’s bootstrap dev-bundle. Please report as a GitHub issue

1 Like