-
-
Notifications
You must be signed in to change notification settings - Fork 106
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
Failed converting Markdown. (Protocol error (Target.setDiscoverTargets): Target closed.)
in AWS ECS
#543
Comments
I'm not very familiar with ECS, but do you think it will work if swapped is-docker to is-inside-container? |
It might solve the problem, but unfortunately If you would like, I can create a PR to publish the ES Module along with CommonJS as well. |
Marp CLI has already used a lot of pure ESM packages, including |
I think it is because I think the reason it is bundled is because However, // src/utils/docker.ts
// import _isDocker from 'is-docker';
import isInsideContainer from 'is-inside-container';
export const isDocker = () => isOfficialImage() || isInsideContainer();
export const isOfficialImage = () => !!process.env.MARP_USER; Thus, running $ node marp-cli.js
...
Error [ERR_REQUIRE_ESM]: require() of ES Module /home/study/workspace/marp-cli/node_modules/is-inside-container/index.js from /home/study/workspace/marp-cli/lib/marp-cli-d775c9f3.js not supported.
Instead change the require of index.js in /home/study/workspace/marp-cli/lib/marp-cli-d775c9f3.js to a dynamic import() which is available in all CommonJS modules.
at Object.<anonymous> (/home/study/workspace/marp-cli/lib/marp-cli-d775c9f3.js:1:383)
at Object.<anonymous> (/home/study/workspace/marp-cli/lib/marp-cli.js:1:75)
at Object.<anonymous> (/home/study/workspace/marp-cli/marp-cli.js:5:1) {
code: 'ERR_REQUIRE_ESM'
} Therefore, if we want to use |
We don't have to need to ship CLI as ESM. Check out #544. rollup will bundle |
Released new version v3.2.1, that is using Could you try it? If ECS used Podman to host the container, it may mitigate the issue brought by Chromium and its sandbox. |
Perhaps there was an error in perception on my part. Thank you very much. I will check it out. |
I guess I didn't understand about the
I updated the version and Deployed to ECS to check, but got an error. However, the error message changed to the following. |
Try updating your Dockerfile to run Chrome as non root user, as does in official images such as Marp CLI and Puppeteer. It's also helpful for debug to set |
Thank you. |
I thought the error had changed, but the debug log shows that the error has not changed.
|
AWS ECS, that is mentioned at the subject, basically just hosts the built container image, so it is unlikely that ECS is the root cause. What AWS service are you using to run the image? If the workaround the |
I use
Yes, I believe so. |
v3.3.0 provides |
I did not reproduce this when I built the Docker image and
docker run
in my local environment, but when I deployed the container with the same Docker image to AWS ECS, the following error occurred.I debugged it and found that
isDocker
(https://github.com/marp-team/marp-cli/blob/main/src/utils/docker.ts#L3) wastrue
in the local environment, butfalse
in the ECS.I think it is because the
is-docker
package is not correctly determining that it is a Docker container.environment
Dockerfile
I use Marp CLI through Node.js. (https://github.com/marp-team/marp-cli#api-experimental)
I already referenced
Tentative error resolution I have found.
From the following code,
isDocker
istrue
even if the environment variableMARP_USER
is present.https://github.com/marp-team/marp-cli/blob/main/src/utils/docker.ts#L4
In other words, the error could be resolved by setting the environment variable
MARP_USER
in a hackish way, although it is not an official image.The text was updated successfully, but these errors were encountered: