Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running in container fails #37

Open
twam opened this issue Dec 20, 2023 · 3 comments
Open

Running in container fails #37

twam opened this issue Dec 20, 2023 · 3 comments

Comments

@twam
Copy link

twam commented Dec 20, 2023

I followed the steps in the README to run lv_img_conv in a container:

docker build -t lv_img_conv .

It fails to build canvas@2.9.0. Adding the missing dependency

RUN apt update && apt install libsdl-pango-dev -y

to the docker solves this.

However if I then run

docker run -ti --rm -u 1000:1000 lv_img_conv lv_img_conv.js

it fails with:

npx: installed 17 in 1.434s
@swc/core threw an error when attempting to validate swc compiler options.
You may be using an old version of swc which does not support the options used by ts-node.
Try upgrading to the latest version of swc.
Error message from swc:
Failed to deserialize buffer as swc::config::Options
JSON: {"sourceMaps":true,"module":{"type":"commonjs","noInterop":false,"strictMode":true,"ignoreDynamic":false},"swcrc":false,"jsc":{"parser":{"syntax":"typescript","tsx":false,"dynamicImport":true,"importAssertions":true},"target":"es5","transform":{"legacyDecorator":true,"react":{"throwIfNamespace":false,"useBuiltins":false,"runtime":"automatic"},"useDefineForClassFields":false},"keepClassNames":false,"experimental":{"keepImportAttributes":true,"emitAssertForImportAttributes":true}}}

Caused by:
    unknown field `keepImportAttributes`, expected one of `plugins`, `keepImportAssertions`, `cacheRoot` at line 1 column 484
@cbeeler
Copy link

cbeeler commented Jan 4, 2024

My team is having the same issue on a build that hasn't changed but has suddenly started failing on our CI machines with the same error.

@Risto97
Copy link

Risto97 commented May 2, 2024

That Dockerfile is just wrong it seems:

I managed to get it to work with the following Dockerfile

FROM ubuntu:20.04

ENV PATH=/usr/src/app:$PATH

RUN mkdir -p /usr/src/app
RUN apt update
RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata
RUN apt install -y gcc make g++ pkg-config libpixman-1-dev libcairo2-dev libpango1.0-dev libjpeg8-dev libgif-dev nodejs npm
RUN npm install -g ts-node
COPY . /usr/src/app
RUN cd /usr/src/app && npm install

VOLUME /usr/src/proj

WORKDIR /usr/src/proj

ENTRYPOINT ["entrypoint.sh"]

@toxxin
Copy link

toxxin commented Nov 29, 2024

@Risto97 your Dockerfile also doesn't work for me. I fixed the versions of core and ts and it seems it works now. It looks like:

FROM node:14

ENV PATH=/usr/src/app:$PATH

RUN mkdir -p /usr/src/app
COPY . /usr/src/app
RUN cd /usr/src/app && npm install typescript && npm install @swc/core@1.3.78 ts-node@10.9.1

VOLUME /usr/src/proj

WORKDIR /usr/src/proj

ENTRYPOINT ["entrypoint.sh"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants