question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

error "The path argument must be of type string. Received null." when trying to build plugin or create new plugin since nativescript-cli 7.x

See original GitHub issue

Environment Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 7.0.8

  • Cross-platform modules: -

  • Android Runtime: -

  • iOS Runtime: -

  • Plugin(s): -

    Just in case this is important to know: - Node: 12.18.1

Describe the bug When I go to the src folder of my plugin and try to run npm run build, the process fails with the following error message: The "path" argument must be of type string. Received undefined.

When I try to create a new plugin using tns create plugin myplugin, I get a similar error message: The "path" argument must be of type string. Received null.

Full log:

? What is your GitHub username? (will be used to update the Github URLs in the plugin’s package.json) NativeScriptDeveloper ? What will be the name of your plugin? (use lowercase characters and dashes only) testplugin ? Do you want to include a “TypeScript NativeScript” application linked with your plugin to make development easier? Yes ? Do you want to include an “Angular NativeScript” application linked with your plugin to make development easier? No NativeScript Plugin Seed Configuration Using Testplugin as the TypeScript Class name… Will now rename some files… Creating ‘TypeScript’ application from latest published template… You are using the deprecated nsconfig.json file. Just be aware that NativeScript 7 has an improved nativescript.config.(js|ts) file for when you’re ready to upgrade this project. The “path” argument must be of type string. Received null TypeScript-NativeScript application created at: …/demo Adjusting scripts… Installing plugin to …/demo … Error: Command failed: cd …/demo && tns plugin add …/src /bin/sh: line 0: cd: …/demo: No such file or directory

at ChildProcess.exithandler (child_process.js:303:12)
at ChildProcess.emit (events.js:315:20)
at maybeClose (internal/child_process.js:1021:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) {

killed: false, code: 1, signal: null, cmd: ‘cd …/demo && tns plugin add …/src’ } Solution for myplugin was successfully created.

When I try to build this plugin, I get the same error message as for my already existing plugin.

To Reproduce see description

Expected behavior Creating a new plugin should not throw this error. Building an existing plugin should not throw this error.

Sample project

Additional context

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

7reactions
rigor789commented, Oct 21, 2020

The commit above fixes the ns plugin build command - the ns plugin create command has to be fixed in the plugin seed, and should be addressed separately.

For those having issues with ns create project - make sure you are using the latest templates, they are now scoped under the @nativescript scope. For example ns create myTSApp --template @nativescript/template-blank-ts

6reactions
Logikgatecommented, Oct 7, 2020

I am also running into this with 7.0.10 when running tns plugin build. It is also complaining about the use of nsconfig.json but there is no nsconfig.json in the plugin project

You are using the deprecated nsconfig.json file. Just be aware that NativeScript 7 has an improved nativescript.config.(js|ts) file for when you're ready to upgrade this project.
The "path" argument must be of type string. Received type undefined
Read more comments on GitHub >

github_iconTop Results From Across the Web

The "path" argument must be of type string. Received null
1 Answer 1 ... Because can't find template path. ns create ProjectName --template @nativescript/TemplateName. Example : ns create HelloWorld -- ...
Read more >
Npm Start Issues With Reactscripts 3.4.0 - ADocLib
error The path argument must be of type string. Received null. when trying to build plugin or create new plugin since nativescriptcli 7.x...
Read more >
PHP Fatal error with file uploads | Argument #1 ($path) must ...
Hi, there is a bug in your plugin, when using the file upload field. ... TypeError: basename(): Argument #1 ($path) must be of...
Read more >
Marshalling - NativeScript Docs
NativeScript exposes an Objective-C class and its members as a JavaScript constructor function with an associated prototype according to the prototypal ...
Read more >
npm err! code err_invalid_arg_type npm err! the "path ...
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received null #38058. StackOverflow.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found