Skip to content

(wrong-type-argument stringp nil) when running projectile in a newly created project #1886

@Toctave

Description

@Toctave

Expected behavior

When I run e.g. projectile-compile-project in a repository I have just created, it should ask for a compile command and run it. Or maybe it could ask me to define a project directory if it's confused.

Actual behavior

Instead, I get this error and backtrace :

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  find-file-name-handler(nil file-remote-p)
  file-remote-p(nil)
  projectile-project-root(nil)
  projectile-acquire-root()
  projectile-read-command("Compile command: " nil)
  projectile-maybe-read-command(nil nil "Compile command: ")
  projectile--run-project-cmd(nil #<hash-table equal 1/65 0x180bb50cde1b> :show-prompt nil :prompt-prefix "Compile command: " :save-buffers t :use-comint-mode nil)
  projectile-compile-project(nil)
  funcall-interactively(projectile-compile-project nil)
  call-interactively(projectile-compile-project nil nil)
  command-execute(projectile-compile-project)

If I exit emacs and run it again, then it works correctly.

Steps to reproduce the problem

  1. Open emacs
  2. Create a new folder and a git repository in it
  3. Navigate to that folder
  4. Run a projectile command, such as projectile-compile-project

Environment & Version information

Projectile version information

Include here the version string displayed by M-x projectile-version. Here's an example:

Projectile 20231013.1509

Emacs version

Emacs 29.1

Operating system

Ubuntu 22.04

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions