Unexpected error when resolving project in the current directory #167

Closed
opened 2025-12-30 01:21:41 +01:00 by adam · 1 comment
Owner

Originally created by @pauloborges on GitHub (Jun 14, 2024).

$ cat PklProject
amends "pkl:Project"
$ cat main.pkl
foo {
  bar = 1
}
$ tree .
.
├── PklProject
└── main.pkl

1 directory, 2 files
$ pkl project resolve .
An unexpected error has occurred. Would you mind filing a bug report?

java.lang.NullPointerException
	at org.pkl.cli.CliProjectResolver.doRun(CliProjectResolver.kt:47)
	at org.pkl.commons.cli.CliCommand.run(CliCommand.kt:45)
	at org.pkl.cli.commands.ProjectCommand$Companion$ResolveCommand.run(ProjectCommand.kt:71)
	at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:198)
	at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:211)
	at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:211)
	at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:18)
	at com.github.ajalt.clikt.core.CliktCommand.parse(CliktCommand.kt:400)
	at com.github.ajalt.clikt.core.CliktCommand.parse$default(CliktCommand.kt:397)
	at com.github.ajalt.clikt.core.CliktCommand.main(CliktCommand.kt:415)
	at com.github.ajalt.clikt.core.CliktCommand.main(CliktCommand.kt:440)
	at org.pkl.cli.Main$main$1.invoke(Main.kt:52)
	at org.pkl.cli.Main$main$1.invoke(Main.kt:40)
	at org.pkl.commons.cli.CliMainKt.cliMain(CliMain.kt:31)
	at org.pkl.cli.Main.main(Main.kt:40)
$ cd ..
$ pkl project resolve pkl-bug-report
pkl-bug-report/PklProject.deps.json
$ tree pkl-bug-report
pkl-bug-report
├── PklProject
├── PklProject.deps.json
└── main.pkl

1 directory, 3 files
Originally created by @pauloborges on GitHub (Jun 14, 2024). ```bash $ cat PklProject amends "pkl:Project" $ cat main.pkl foo { bar = 1 } $ tree . . ├── PklProject └── main.pkl 1 directory, 2 files $ pkl project resolve . An unexpected error has occurred. Would you mind filing a bug report? java.lang.NullPointerException at org.pkl.cli.CliProjectResolver.doRun(CliProjectResolver.kt:47) at org.pkl.commons.cli.CliCommand.run(CliCommand.kt:45) at org.pkl.cli.commands.ProjectCommand$Companion$ResolveCommand.run(ProjectCommand.kt:71) at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:198) at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:211) at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:211) at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:18) at com.github.ajalt.clikt.core.CliktCommand.parse(CliktCommand.kt:400) at com.github.ajalt.clikt.core.CliktCommand.parse$default(CliktCommand.kt:397) at com.github.ajalt.clikt.core.CliktCommand.main(CliktCommand.kt:415) at com.github.ajalt.clikt.core.CliktCommand.main(CliktCommand.kt:440) at org.pkl.cli.Main$main$1.invoke(Main.kt:52) at org.pkl.cli.Main$main$1.invoke(Main.kt:40) at org.pkl.commons.cli.CliMainKt.cliMain(CliMain.kt:31) at org.pkl.cli.Main.main(Main.kt:40) $ cd .. $ pkl project resolve pkl-bug-report pkl-bug-report/PklProject.deps.json $ tree pkl-bug-report pkl-bug-report ├── PklProject ├── PklProject.deps.json └── main.pkl 1 directory, 3 files ```
adam closed this issue 2025-12-30 01:21:41 +01:00
Author
Owner

@holzensp commented on GitHub (Jun 19, 2024):

I've (trivially) reproduced this with 0.26.0. The problem is the .; pkl project resolve (inside pkl-bug-report) runs without issue, as does pkl project resolve pkl-bug-report from the parent dir (as reported). Thanks for the bug report, @pauloborges!

@holzensp commented on GitHub (Jun 19, 2024): I've (trivially) reproduced this with 0.26.0. The problem is the `.`; `pkl project resolve` (inside `pkl-bug-report`) runs without issue, as does `pkl project resolve pkl-bug-report` from the parent dir (as reported). Thanks for the bug report, @pauloborges!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pkl#167