TypeError: Tried to lookup Dir

This just started happening when cloning and loading up in VS Code.
Any ideas what might be causing this?


Resolving iec-nugget dependencies...
Already up-to-date.
Updating metadata for the vscode IDE...
UserSideException: Processing iec-nugget (board: esp32-16mb; platform: espressif32@6.4.0; framework: espidf)
--------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
Replacing MKSPIFFSTOOL with mklittlefs
Automatic versioning disabled
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32-16mb.html
PLATFORM: Espressif 32 (6.4.0) > Meatloaf v1
HARDWARE: ESP32 240MHz, 4.31MB RAM, 16MB Flash
DEBUG: Current (ftdi) On-board (ftdi) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES: 
 - framework-espidf @ 3.50101.230828 (5.1.1) 
 - tool-cmake @ 3.16.4 
 - tool-esptoolpy @ 1.40501.0 (4.5.1) 
 - tool-ninja @ 1.9.0 
 - tool-riscv32-esp-elf-gdb @ 12.1.0+20221002 
 - tool-xtensa-esp-elf-gdb @ 12.1.0+20221002 
 - toolchain-esp32ulp @ 1.23500.220830 (2.35.0) 
 - toolchain-xtensa-esp32 @ 12.2.0+20230208
TypeError: Tried to lookup Dir '/Users/jjohnston/.platformio/platforms/espressif32/builder' as a File.:
  File "/Users/jjohnston/.platformio/penv/lib/python3.11/site-packages/platformio/builder/main.py", line 173:
    env.SConscript("$BUILD_SCRIPT")
  File "/Users/jjohnston/.platformio/packages/tool-scons/scons-local-4.7.0/SCons/Script/SConscript.py", line 612:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/Users/jjohnston/.platformio/packages/tool-scons/scons-local-4.7.0/SCons/Script/SConscript.py", line 279:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "/Users/jjohnston/.platformio/platforms/espressif32/builder/main.py", line 346:
    target_elf = env.BuildProgram()
  File "/Users/jjohnston/.platformio/packages/tool-scons/scons-local-4.7.0/SCons/Util/envs.py", line 251:
    return self.method(*nargs, **kwargs)
  File "/Users/jjohnston/.platformio/penv/lib/python3.11/site-packages/platformio/builder/tools/piobuild.py", line 61:
    env.ProcessProgramDeps()
  File "/Users/jjohnston/.platformio/packages/tool-scons/scons-local-4.7.0/SCons/Util/envs.py", line 251:
    return self.method(*nargs, **kwargs)
  File "/Users/jjohnston/.platformio/penv/lib/python3.11/site-packages/platformio/builder/tools/piobuild.py", line 118:
    env.ProcessFlags(env.get("BUILD_FLAGS"))
  File "/Users/jjohnston/.platformio/packages/tool-scons/scons-local-4.7.0/SCons/Util/envs.py", line 251:
    return self.method(*nargs, **kwargs)
  File "/Users/jjohnston/.platformio/penv/lib/python3.11/site-packages/platformio/builder/tools/piobuild.py", line 233:
    env.Append(**env.ParseFlagsExtended(flags))
  File "/Users/jjohnston/.platformio/packages/tool-scons/scons-local-4.7.0/SCons/Util/envs.py", line 251:
    return self.method(*nargs, **kwargs)
  File "/Users/jjohnston/.platformio/penv/lib/python3.11/site-packages/platformio/builder/tools/piobuild.py", line 195:
    for key, value in env.ParseFlags(str(raw)).items():
  File "/Users/jjohnston/.platformio/packages/tool-scons/scons-local-4.7.0/SCons/Environment.py", line 1043:
    do_parse(arg)
  File "/Users/jjohnston/.platformio/packages/tool-scons/scons-local-4.7.0/SCons/Environment.py", line 961:
    mapping['LIBS'].append(self.fs.File(arg))
  File "/Users/jjohnston/.platformio/packages/tool-scons/scons-local-4.7.0/SCons/Node/FS.py", line 1453:
    return self._lookup(name, directory, File, create)
  File "/Users/jjohnston/.platformio/packages/tool-scons/scons-local-4.7.0/SCons/Node/FS.py", line 1432:
    return root._lookup_abs(p, fsclass, create)
  File "/Users/jjohnston/.platformio/packages/tool-scons/scons-local-4.7.0/SCons/Node/FS.py", line 2471:
    result.must_be_same(klass)
  File "/Users/jjohnston/.platformio/packages/tool-scons/scons-local-4.7.0/SCons/Node/FS.py", line 642:
    raise TypeError("Tried to lookup %s '%s' as a %s." %\
========================== [FAILED] Took 0.87 seconds ==========================

Environment    Status    Duration
-------------  --------  ------------
iec-nugget     FAILED    00:00:00.869
==================== 1 failed, 0 succeeded in 00:00:00.869 ====================

And that happens with what platformio.ini?

I haven’t changed anything in my platformio.ini.

This is the repo. If you clone it and then copy platformio.ini.sample to platformio.ini, then load it up in VS Code it should give the error messages above. That’s what I did to reproduce it. Happens on OXS and Linux. I haven’t tired on Windows yet but I suspect it’s something with platformio.

Found the issue. It was in my platformio.ini file.
I had board_build.filesystem = littlefs in the [env] section and it needed to be in [esp32_base].

1 Like