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

Container failed to start Example export no found #70

Open
drlebedev opened this issue Feb 24, 2025 · 2 comments
Open

Container failed to start Example export no found #70

drlebedev opened this issue Feb 24, 2025 · 2 comments

Comments

@drlebedev
Copy link

The latest built-from-source container fails to start with the following stack trace:

file:///home/node/xen-orchestra/@xen-orchestra/rest-api/dist/vms/vm.controller.mjs:10 xo | import { Example, Get, Path, Query, Request, Response, Route, Security } from 'tsoa'; xo | ^^^^^^^ xo | SyntaxError: Named export 'Example' not found. The requested module 'tsoa' is a CommonJS module, which may not support all module.exports as named exports. xo | CommonJS modules can always be imported via the default export, for example using: xo | xo | import pkg from 'tsoa'; xo | const { Example, Get, Path, Query, Request, Response, Route, Security } = pkg; xo | xo | at ModuleJob._instantiate (node:internal/modules/esm/module_job:146:21) xo | at async ModuleJob.run (node:internal/modules/esm/module_job:229:5) xo | at async ModuleLoader.import (node:internal/modules/esm/loader:473:24) xo | at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:122:5)

Container build parameters used:
--pull
--no-cache

@bufanda
Copy link
Contributor

bufanda commented Feb 24, 2025

Seems to be an Upstream issue since building a container image with Commit 5dbb5291262f6e392a96ec7fe85a437b6873e1c9 @ https://github.com/vatesfr/xen-orchestra/commits/master/
Works and everything after seems broken as the commit immediately after introduces the files causing this issue.

I am not really familiar with node build processes so could be just a missing depedency or so.

@bufanda
Copy link
Contributor

bufanda commented Mar 5, 2025

Ok, did some more digging looks like these steps in the cleanup removes too many of modules and breaks things. Commenting them and the latest version of Xen-Orchestra runs fine.

RUN npm install -g modclean
RUN modclean -r
# remove unused files like docs, empty files... (scrap something like 25Mo)
RUN curl -sf https://gobinaries.com/tj/node-prune | sh
RUN node-prune

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