Solid.JS app fails on deployment (vite ERR_MODULE_NOT_FOUND)

Hi All,

I’m trying to deploy a Solid.JS Meteor web app to Galaxy. Solid uses vite as the build tool.

When I deploy the app to Galaxy, I get the following error:

2023-10-13 14:22:53-03:00 Step 6/6 : RUN cd repo && cd ./ && DEPLOY_HOSTNAME=galaxy.meteor.com TOOL_NODE_FLAGS='--max-old-space-size=5632' meteor deploy clic.meteorapp.com --owner edoscl --mongo --container-size tiny --plan free --no-wait --allow-superuser --deploy-token *****
2023-10-13 14:22:53-03:00  ---> Running in 617c781a03d8
2023-10-13 14:25:42-03:00 Talking to Galaxy servers at https://galaxy.meteor.com
2023-10-13 14:25:46-03:00 Preparing to build your app...
2023-10-13 14:25:47-03:00 ⚡️ Building packages to make them available to export analyzer...
2023-10-13 14:26:20-03:00 ⚡️ Packages built (32447.38ms)
2023-10-13 14:26:20-03:00 ⚡️ Building with Vite...
2023-10-13 14:26:20-03:00  internal/process/esm_loader.js:74
2023-10-13 14:26:20-03:00  internalBinding('errors').triggerUncaughtException(
2023-10-13 14:26:20-03:00  ^
2023-10-13 14:26:20-03:00
2023-10-13 14:26:20-03:00 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'vite' imported from /home/mt/repo/node_modules/.meteor-vite-build-worker.mjs
2023-10-13 14:26:20-03:00  at new NodeError (internal/errors.js:322:7)
2023-10-13 14:26:20-03:00  at packageResolve (internal/modules/esm/resolve.js:732:9)
2023-10-13 14:26:20-03:00  at moduleResolve (internal/modules/esm/resolve.js:773:18)
2023-10-13 14:26:20-03:00  at Loader.defaultResolve [as _resolve (internal/modules/esm/resolve.js:887:11)
2023-10-13 14:26:20-03:00  at Loader.resolve (internal/modules/esm/loader.js:89:40)
2023-10-13 14:26:20-03:00  at Loader.getModuleJob (internal/modules/esm/loader.js:242:28)
2023-10-13 14:26:20-03:00  at ModuleWrap.<anonymous (internal/modules/esm/module_job.js:76:40)
2023-10-13 14:26:20-03:00  at link (internal/modules/esm/module_job.js:75:36) {
2023-10-13 14:26:20-03:00 code: 'ERR_MODULE_NOT_FOUND'
2023-10-13 14:26:20-03:00 }
2023-10-13 14:26:31-03:00
2023-10-13 14:26:31-03:00 Errors prevented deploying:
2023-10-13 14:26:31-03:00 While loading plugin `vite` from package `vite:bundler`:
2023-10-13 14:26:31-03:00 <runJavaScript-40>:633:11: Command failed with exit code 1: meteor node
2023-10-13 14:26:31-03:00 /home/mt/repo/node_modules/.meteor-vite-build-worker.mjs
2023-10-13 14:26:31-03:00 at makeError (<runJavaScript-40>:633:11)
2023-10-13 14:26:31-03:00 at execaSync (<runJavaScript-40>:489:17)
2023-10-13 14:26:31-03:00 at packages/vite/build.js:262:18
2023-10-13 14:26:31-03:00 at module (packages/vite/build.js:376:2)
2023-10-13 14:26:31-03:00 at fileEvaluate (packages/modules-runtime.js:336:7)
2023-10-13 14:26:31-03:00 at Module.require (packages/modules-runtime.js:238:14)
2023-10-13 14:26:31-03:00 at require (packages/modules-runtime.js:258:21)
2023-10-13 14:26:31-03:00 at <runJavaScript-40>:1989:1
2023-10-13 14:26:31-03:00 at <runJavaScript-40>:1994:3v0000
2023-10-13 14:26:31-03:00
2023-10-13 14:26:31-03:00
2023-10-13 14:26:36-03:00  Removing intermediate container 617c781a03d8
2023-10-13 14:26:36-03:00 Error trying to start deploy - The command '/bin/bash -c cd repo && cd ./ && DEPLOY_HOSTNAME=galaxy.meteor.com TOOL_NODE_FLAGS='--max-old-space-size=5632' meteor deploy clic.meteorapp.com --owner edoscl --mongo --container-size tiny --plan free --no-wait --allow-superuser --deploy-token *****' returned a non-zero code: 1

There is no problem building locally (meteor build ..\dist). I’m using Meteor 2.13.3 with Node version 14.21.3.

The app is pulled by Galaxy from its GitHub repository.

Thank you in advance for your help.

The builder is using esm but seems the meteor-vite compiler doesn’t support it

Hi @edoscl, is this a private repository? If not, could you share it with us? I would like to have a look at the code and try to reproduce it.

Hello @denyhs ,

It’s a private repository, but if it helps I can temporarily share it with you. I’d need a GitHub user/email.

Regards.

Can you open a ticket on Galaxy instead? I think it’d be better. You can send an email to support@meteor.com.