Louis Deconinck
Louis Deconinckthis hour

Why is no code showing in the web IDE?

Anyone know why my code is not showing in the web IDE? I've adjusted the Dockerfile, so that might be why. What should I change?
# Specify the base Docker image. You can read more about
# the available images at https://crawlee.dev/docs/guides/docker-images
# Using actor-node-playwright-chrome which is Debian-based (glibc) for onnxruntime-node compatibility
FROM apify/actor-node-playwright-chrome:22-1.54.1 AS builder

# Check preinstalled packages
RUN npm ls crawlee apify puppeteer playwright

# Copy just package.json and package-lock.json
# to speed up the build using Docker layer cache.
COPY --chown=myuser:myuser package*.json ./

# Install all dependencies. Don't audit to speed up the installation.
RUN npm install --include=dev --audit=false

# Next, copy the source files using the user set
# in the base image.
COPY --chown=myuser:myuser . ./

# Install all dependencies and build the project.
# Don't audit to speed up the installation.
RUN npm run build

# Create final image - using Playwright image for glibc (required by onnxruntime-node)
FROM apify/actor-node-playwright-chrome:22-1.54.1

# Check preinstalled packages
RUN npm ls crawlee apify puppeteer playwright

# Copy just package.json and package-lock.json
# to speed up the build using Docker layer cache.
COPY --chown=myuser:myuser package*.json ./

# Install NPM packages, skip optional and development dependencies
RUN npm --quiet set progress=false \
&& npm install --omit=dev \
&& echo "Installed NPM packages:" \
&& (npm list --omit=dev --all || true) \
&& echo "Node.js version:" \
&& node --version \
&& echo "NPM version:" \
&& npm --version \
&& rm -r ~/.npm

# Copy built JS files from builder image
COPY --from=builder --chown=myuser:myuser /home/myuser/dist ./dist

# Next, copy the remaining files and directories with the source code.
COPY --chown=myuser:myuser . ./

# Run the image.
CMD npm run start:prod --silent
# Specify the base Docker image. You can read more about
# the available images at https://crawlee.dev/docs/guides/docker-images
# Using actor-node-playwright-chrome which is Debian-based (glibc) for onnxruntime-node compatibility
FROM apify/actor-node-playwright-chrome:22-1.54.1 AS builder

# Check preinstalled packages
RUN npm ls crawlee apify puppeteer playwright

# Copy just package.json and package-lock.json
# to speed up the build using Docker layer cache.
COPY --chown=myuser:myuser package*.json ./

# Install all dependencies. Don't audit to speed up the installation.
RUN npm install --include=dev --audit=false

# Next, copy the source files using the user set
# in the base image.
COPY --chown=myuser:myuser . ./

# Install all dependencies and build the project.
# Don't audit to speed up the installation.
RUN npm run build

# Create final image - using Playwright image for glibc (required by onnxruntime-node)
FROM apify/actor-node-playwright-chrome:22-1.54.1

# Check preinstalled packages
RUN npm ls crawlee apify puppeteer playwright

# Copy just package.json and package-lock.json
# to speed up the build using Docker layer cache.
COPY --chown=myuser:myuser package*.json ./

# Install NPM packages, skip optional and development dependencies
RUN npm --quiet set progress=false \
&& npm install --omit=dev \
&& echo "Installed NPM packages:" \
&& (npm list --omit=dev --all || true) \
&& echo "Node.js version:" \
&& node --version \
&& echo "NPM version:" \
&& npm --version \
&& rm -r ~/.npm

# Copy built JS files from builder image
COPY --from=builder --chown=myuser:myuser /home/myuser/dist ./dist

# Next, copy the remaining files and directories with the source code.
COPY --chown=myuser:myuser . ./

# Run the image.
CMD npm run start:prod --silent
No description
Solution:
@Louis Deconinck I checked your case and unfortunately this is a feature of apify-cli, to upload large directories as a zip archive and therefore it doesn't show up in the WebIDE. It is mentioned in the doc....
No description
Jump to solution
5 Replies
Pepa J
Pepa J7h ago
Hi @Louis Deconinck How do you build your Actor? The code will not show in the WebIDE in case you build it from external source (like git repository). To push the code to the Console with the code you can use apify-cli push command see https://docs.apify.com/cli You can also sent the ActorId to my DM and I can take a look.
Louis Deconinck
Louis DeconinckOP7h ago
I always use the CLI with apify-push I've sent the actor ID to your DM. Thanks for taking a look! I suspect possibly the README is too big as I've included a sample output which is quite large.
Solution
Pepa J
Pepa J6h ago
@Louis Deconinck I checked your case and unfortunately this is a feature of apify-cli, to upload large directories as a zip archive and therefore it doesn't show up in the WebIDE. It is mentioned in the doc.
No description
Louis Deconinck
Louis DeconinckOP6h ago
I see, thanks for confirming this suspicion. I'll look to trim down the README. What is the recommended way to build an actor? CLI or GitHub repo?
Pepa J
Pepa J6h ago
That really depends on your use case, do you want to be able to update the code in Apify Console? Then CLI makes sense, but then of course these changes are not propagated to your local code. Generally, having single (versioned) source of truth for the code (like a git repository) is preferred.

Did you find this page helpful?