Skip to content

The "path" argument must be of type string. Received type undefined #200

Closed

Description

@matheuss

We have a project with the following dependencies:

{
  "dependencies": {
    "mongodb": "3.1.8",
    "truncate-utf8-bytes": "1.0.2"
  },
  "devDependencies": {
    "@zeit/best": "0.4.3",
    "@zeit/eslint-config-node": "0.3.0",
    "@zeit/ncc": "0.5.5",
    "eslint": "5.7.0"
  }

If I run node index.js, it exits just fine (as expected):

▲ (matheus-vm) collector [master] node index.js
▲ (matheus-vm) collector [master] echo $?
0
▲ (matheus-vm) collector [master]

However, If i ncc build index.js and run it, it prints an error an a warning:

▲ (matheus-vm) collector [master] ./node_modules/.bin/ncc build index.js
410kB  dist/code-points.mem
428kB  dist/index.js
838kB  [10910ms]
▲ (matheus-vm) collector [master] node dist/index.js
The "path" argument must be of type string. Received type undefined
(node:6811) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
▲ (matheus-vm) collector [master]
▲ (matheus-vm) collector [master] echo $?
0
▲ (matheus-vm) collector [master]

Unfortunately, I can't share the code – it's not open source. These are the requires:

▲ (matheus-vm) collector [master] spot --exclude test 'require('

./lib/mongo.js:
1:const {MongoClient} = require('mongodb');

./index.js:
1:const truncate = require('truncate-utf8-bytes');

./index.js:
2:const {promisify} = require('util');

./index.js:
3:const zlib = require('zlib');

./index.js:
4:const mongo = require('./lib/mongo');

./index.js:
5:const shouldIgnore = require('./lib/should-ignore');

./index.js:
6:const parseMessage = require('./lib/parse-message');

./create-collection.js:
2:const {MongoClient} = require('mongodb');

Activity

  1. guybedford commented on Jan 9, 2019

    @guybedford
    Contributor

    It would help if you could share the line of code giving the error that the path argument is undefined in the build output, as well as the code pattern that caused this from the input. Using ncc run may help to trace the corresponding input source.

  2. guybedford commented on Jan 15, 2019

    @guybedford
    Contributor

    Any update on the replication here at all?

  3. guybedford commented on May 15, 2019

    @guybedford
    Contributor

    I'm going to close this due to the lack of a replication, but just let me know @matheuss if you're able to update here further and we can reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions