michaellzc / vscode-hadolint

VSCode extension to integrate hadolint, a Dockerfile linter, into VSCode
https://marketplace.visualstudio.com/items?itemName=exiasr.hadolint
MIT License
77 stars 5 forks source link

Error: Cannot read property 'length' of undefined #46

Closed njgrisafi closed 3 years ago

njgrisafi commented 3 years ago

The following Dockerfile:

FROM python:2.7.17-slim-buster

RUN apt-get update && apt-get install --no-install-recommends -y \
    wget libtinfo5 libusb-0.1-4 \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

RUN wget -nv http://archive.ubuntu.com/ubuntu/pool/main/r/readline6/libreadline6_6.3-8ubuntu2_amd64.deb -O /tmp/libreadline6.deb \
    && wget -nv http://archive.ubuntu.com/ubuntu/pool/main/g/gnupg/gnupg_1.4.20-1ubuntu3_amd64.deb /tmp/gnupg.deb \
    && dpkg -i /tmp/libreadline6.deb \
    && dpkg -i /tmp/gnupg.deb \
    && rm -f /tmp/libreadline6.deb /tmp/gnupg.deb

RUN apt-get update -y && apt-get install --no-install-recommends --fix-missing -y \
    build-essential \
    context \
    curl \
    gcc-8 \
    gettext-base \
    ghostscript \
    jq \
    libffi-dev \
    libldap2-dev \
    libmagickwand-dev \
    libncurses5-dev \
    libpango1.0-dev \
    libpng12-0 \
    libsasl2-dev \
    libssl-dev \
    libssl1.0.0 \
    libstdc++6 \
    locales \
    locales-all \
    moreutils \
    nginx \
    openssh-client \
    openssh-client-ssh1 \
    pandoc \
    pdftk \
    software-properties-common \
    tesseract-ocr \
    xfonts-75dpi \
    xfonts-75dpi \
    xmlsec1 \
    xvfb \
    zlib1g-dev \
    poppler-utils \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*
RUN apt-get update -y && apt-get install --no-install-recommends -y \
    fonts-liberation \
    libappindicator3-1 \
    libatk-bridge2.0-0 \
    libatk1.0-0 \
    libatspi2.0-0 \
    libgtk-3-0 \
    libxss1 \
    libgbm1

When saving the file above, vscode shows an error hadolint: Cannot read property 'length' of undefined: image

Any ideas why this would occur?

njgrisafi commented 3 years ago

Closing the file and reopening seems to have fixed the error...but still strange to see. Maybe this has something to do with VSCode and not the extension itself. (I'm running on MacOS)

michaellzc commented 3 years ago

Closing the file and reopening seems to have fixed the error...but still strange to see. Maybe this has something to do with VSCode and not the extension itself. (I'm running on MacOS)

@njgrisafi

The problem seems to go away since vscode upgrade this week. Would you double-check?

njgrisafi commented 3 years ago

@ExiaSR I performed the update to Version: 1.55.2 and I haven't been able to repro the error. That should hopefully do the trick thank you!

tekumara commented 2 years ago

I'm encountering this with vscode 1.60.1 and hadolint 2.7.0-no-git and this Dockerfile:

FROM python:3.8-slim

RUN pip install --no-cache-dir "uvicorn[standard]" gunicorn
KerickHowlett commented 2 years ago

I'm using VS Code version 1.62.3 and Hadolint 2.8.0.

Although, hadolint -v outputs Haskell Dockerfile Linter UNKNOWN. I had to get the version number by reinstalling hadolint via brew.

Anyway, I'm still getting the VSCode error of "hadolint: Cannot read property 'length' of undefined" every single time I save my Dockerfile.

jacek-jablonski commented 2 years ago

I'm using VS Code version 1.62.3 and Hadolint 2.8.0.

Although, hadolint -v outputs Haskell Dockerfile Linter UNKNOWN. I had to get the version number by reinstalling hadolint via brew.

Anyway, I'm still getting the VSCode error of "hadolint: Cannot read property 'length' of undefined" every single time I save my Dockerfile.

Same for me. Error shows every time I save Dockerfile.

mar0us commented 5 months ago

the error still exists on vs code 1.88.0, it seems that the hadolint version does not matter, because there are no errors in the console.