PlatformIO Community

Error occurred while glob on examples in my library

Hi I recently update my library.json because it was taking all my examples as one. At the web page it’s alright, showing the 3 examples, but in VSCode throws me this error:

Error occurred while glob [{"name":"toUpper and toLower","base":"examples/","files":["example1.c"]},{"name":"Long data lenght","base":"examples/","files":["example2.c"]},{"name":"Sending raw data","base":"examples/","files":["example3.c"]}]
Server error: {"type":"TypeError","args":["join() argument must be str, bytes, or os.PathLike object, not 'dict'"],"message":"join() argument must be str, bytes, or os.PathLike object, not 'dict'"}

How can i fix this?

My library.json:

{
    "name": "Serial-libOpenCM3",
    "keywords": "Serial, usart, communication, bluepill, stm32",
    "description": "Serial higher level API for manage the USART with libOpenCM3",
    "authors":
    {
        "name": "Matías S. Ávalos",
        "email": "msavalos@gmail.com",
        "url": "http://electronlinux.wordpress.com"
    },
    "repository":
    {
        "type": "git",
        "url": "https://gitlab.com/tute-avalos/serial-api-libopencm3"
    },
    "export": {
        "exclude": [
            "Makefile",
            "src/Makefile",
            "rules.mk",
            "libopencm3",
            ".gitmodules",
            "stm32f103-bluepill.cfg"
        ]
    },
    "examples": [
        {
            "name": "toUpper and toLower",
            "base": "examples/",
            "files": ["example1.c"]
        },
        {
            "name": "Long data lenght",
            "base": "examples/",
            "files":["example2.c"]
        },
        {
            "name": "Sending raw data",
            "base": "examples/",
            "files":["example3.c"]
        }
    ],
    "license": "LGPL-3.0-or-later",
    "version": "0.4.5",
    "frameworks": "libopencm3",
    "platforms": "ststm32"
}

Sorry if this is a dumb question!

Well except for the fact that your examples all use one shared example folder and not one folder per example per docs, I don’t see a problem (and the former should also not cause it).

I’m not sure whether this is a PlatformIO core error or something in the VSCode extension, but given that it’s complaining about Python code, I would think it’s the first.

Make sure you’re running the latest core version by opening a PIO CLI and running pio upgrade --dev, then restarting VSCode.

If the error still appears please file an issue in https://github.com/platformio/platformio-core/issues so @ivankravets can see it.

I did that and now it says 3 examples (not for name):
imagen

When I choose the version from a project that uses the lib, the error persist:
imagen
imagen

I will try to put one folder per example in the repository.

Thanks.

base should be examples/long-data , etc. Without / in the end. Also try to keep example name without spaces