Skip to content

[bug] [content-publishing] "class-validator" has no exported member named 'ValidationOptions' #798

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

Open
prestonzendev opened this issue Apr 5, 2025 · 6 comments

Comments

@prestonzendev
Copy link

Image

When I run the Gateway repo with Dev Containers, I encounter an error in the Content Publishing API.

@JoeCap08055
Copy link
Contributor

Are you running this from the social-app-template repo, with the DEV_CONTAINERS=true option? If so, try the following:

  1. In your gateway repo, make sure you're on the main branch & pull the latest from github
  2. Build the latest dev container with make docker-build-content-publishing
  3. Try running the start script again (works for me)

Also, verify which image you're running:

  • Published images will show projectlibertylabs/content-publishing-service:latest
  • Dev images will just show content-publishing-service:latest (no org, ie no projectlibertylabs/)

(Either way, both published & dev images work for me.)

But--maybe a platform issue? I'm on Docker Desktop for macOS. (Though I'd think this error would not be affected by the host or build platform, since it's a Node.js runtime issue). However:

  • Published images are multi-platform for linux/amd64 and linux/arm64/v8
  • Dev images will be single-platform for whatever the base image/host OS you built them on

I tested:

  • Published image running linux/arm64/v8 container on macOS
  • Published image running linux/amd64 container on macOS
  • Dev image built linux/aarch64 container on macOS

All of the above work for me.

I haven't booted my Linux box in a while, but I'll see if I can give it a try later. Other that that, I'd say not reproducible for me.

@JoeCap08055
Copy link
Contributor

JoeCap08055 commented Apr 5, 2025

Now that I look at your error again, it looks more likely that you ran the start.sh script from this repo, so I did the same, and also got no errors. You might want to try clearing your Docker build cache and removing any volumes that might have been associated with that container, and trying again fresh.

Again, the only difference would be the platform, but I don't think a platform issue would manifest this type of TS/JS error.

@prestonzendev
Copy link
Author

I encountered an error when running the Gateway repo related to the Content Publishing API. After investigating, I found that the file app/node_modules/class-validator/types/decorator/ValidationOptions.d.ts was empty in the Content Publishing Server Docker container.

To resolve the issue, I filled in the file with the contents from the ValidationOptions.d.ts of the class-validator module, and it worked successfully.

@JoeCap08055
Copy link
Contributor

I encountered an error when running the Gateway repo related to the Content Publishing API. After investigating, I found that the file app/node_modules/class-validator/types/decorator/ValidationOptions.d.ts was empty in the Content Publishing Server Docker container.

Was this a dev container that you built locally, or the published container?

  • If the published container, it's either a hiccup in the release build process, solved by cutting a new release, or it could be a bug in the CI release process.
  • If a dev container that you built locally, again, could be a hiccup in the container build process, or a bug in the script.

My money's on a hiccup (probably network-related, during the 'npm ci' process) in the container build process. However, maybe the image build script should validate that the npm ci was successful before continuing to build an image?

@prestonzendev
Copy link
Author

It was a dev container

@JoeCap08055
Copy link
Contributor

Still unclear as to whether you're running this from the SAT repo or the Gateway repo, as "dev container" means 2 different things in those 2 contexts.

If you're running from the SAT repo, I'd suggest rebuilding your dev images from this (Gateway) repo using make docker-build

If you're running from this repo, "dev" containers map to the local filesystem for the app source, but store their node_modules folder in a local Docker volume. In which case I'd suggest removing any exiting containers & volumes and trying again.

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

2 participants