Apify and Crawlee Official Forum

Updated 4 months ago

Build Fails -node_modules/@crawlee/http/internals/http-crawler.d.ts:387:44 - error TS1005: 'assert'

I'm trying to build an actor using the below packages when I get the above error and many other related to the http-crawler.d.ts file.

"@crawlee/cheerio": "^3.11.1",
"apify": "^3.1.10",
"crawlee": "^3.5.4"

In my docker file I'm using:
apify/actor-node:20
FROM apify/actor-node-playwright-chrome:18

In total there are 142 errors in the same file, starting at: node_modules/@crawlee/http/internals/http-crawler.d.ts:387

Is anyone else having a similar issue?
v
M
4 comments
Hello , could you please send the whole Dockerfile? Do I understand correctly that you are using a different builder and final base image? If so, using the playwright image as a builder base image could help.
Yes, I am using two different builders. Below is my Dockerfile.

Plain Text
# using multistage build, as we need dev deps to build the TS source code
FROM apify/actor-node:20 AS builder

# copy all files, install all dependencies (including dev deps) and build the project
COPY . ./

RUN npm install --include=dev \
    && npm run build

# create final image
FROM apify/actor-node-playwright-chrome:18
# copy only necessary files
COPY --from=builder /usr/src/app/package.json ./
COPY --from=builder /usr/src/app/dist ./dist
COPY --from=builder /usr/src/app/INPUT_SCHEMA.json ./INPUT_SCHEMA.json
COPY --from=builder /usr/src/app/.npmrc ./.npmrc

# install only prod deps
USER root
RUN chown -R 999:999 ".npmrc"
RUN chown -R 999:999 ".npm"

USER myuser

RUN npm --quiet set progress=false \
    && npm install --only=prod --no-optional \
    && echo "Installed NPM packages:" \
    && (npm list --only=prod --no-optional --all || true) \
    && echo "Node.js version:" \
    && node --version \
    && echo "NPM version:" \
    && npm --version

# run compiled code
CMD npm run start:prod
switching the first base image to apify/actor-node-playwright-chrome:18 should help
Hey thanks for a response, however updating this did not solve the issue and the error persists. I was able to resolve my issue but using apify/actor-node-playwright-chrome:16
Add a reply
Sign up and join the conversation on Discord