The project works normally, but when the build command is executed, the desired …file is not generated. What steps should I follow to deploy it? Thank you in advance for your help.
//----------------
Edit:
meteor build ../output/svelte --directory
result:
<img width="552" height="508" alt="Image" src="https://github.com/user-attachments/assets/98ff36a3-e23c-42ed-92e1-c0b95bfd0bbb" />
//----------------
"meteor-vite": "^3.9.0-beta.1"
jorgenvatle:vite@1.6.0-beta.2
vite.config.mts
```vite.config.mts
import { svelte } from '@sveltejs/vite-plugin-svelte'
import tailwindcss from '@tailwindcss/vite'
import { meteor } from 'meteor-vite/plugin'
import { defineConfig } from 'vite'
export default defineConfig({
plugins: [
svelte({
configFile: 'svelte.config.mjs',
}),
tailwindcss(),
meteor({
clientEntry: 'client/entry-vite.ts',
serverEntry: 'server/entry-vite.ts',
enableExperimentalFeatures: true,
stubValidation: {
ignorePackages: ['meteor/alanning:roles', 'meteor/mongo'],
warnOnly: true,
disabled: false, // Disable stub validation in Docker build
},
}),
],
build: {
sourcemap: process.env.NODE_ENV !== 'production',
},
server: {
allowedHosts: [],
},
define: {
// Tell the router to log when we're in debug mode.
// Otherwise, this statement is removed by the compiler (known as tree-shaking)
// and all subsequent log statements are removed at build time:
'import.meta.env.SPA_ROUTER': {
logLevel: 'debug',
},
},
resolve: {
alias: {
tinro5: '/node_modules/tinro5/dist/tinro.es.js',
},
},
})
```
Dockerfile:
```Dockerfile
# The tag here should match the Meteor version of your app, per .meteor/release
FROM geoffreybooth/meteor-base:3.3.2
# Copy app package.json and package-lock.json into container
COPY ./package*.json $APP_SOURCE_FOLDER/
RUN bash $SCRIPTS_FOLDER/build-app-npm-dependencies.sh
RUN echo "SCRIPTS_FOLDER"
RUN echo $SCRIPTS_FOLDER
RUN echo "APP_BUNDLE_FOLDER"
RUN echo $APP_BUNDLE_FOLDER
# Copy app source into container
COPY . $APP_SOURCE_FOLDER/
RUN bash $APP_SOURCE_FOLDER/build-meteor-bundle.sh
# Use the specific version of Node expected by your Meteor release, per https://docs.meteor.com/changelog.html; this is expected for Meteor 3.3.2
FROM node:22.19.0-alpine
ENV APP_BUNDLE_FOLDER=/opt/bundle
ENV SCRIPTS_FOLDER=/docker
# Install OS build dependencies, which stay with this intermediate image but don’t become part of the final published image
RUN apk --no-cache add \
bash \
g++ \
make \
python3
# Copy in entrypoint
COPY --from=0 $SCRIPTS_FOLDER $SCRIPTS_FOLDER/
# Copy in app bundle
COPY --from=0 $APP_BUNDLE_FOLDER/bundle $APP_BUNDLE_FOLDER/bundle/
RUN bash $SCRIPTS_FOLDER/build-meteor-npm-dependencies.sh --build-from-source
# Start another Docker stage, so that the final image doesn’t contain the layer with the build dependencies
# See previous FROM line; this must match
FROM node:22.19.0-alpine
ENV APP_BUNDLE_FOLDER=/opt/bundle
ENV SCRIPTS_FOLDER=/docker
# Install OS runtime dependencies
RUN apk --no-cache add \
bash \
ca-certificates
# Copy in entrypoint with the built and installed dependencies from the previous image
COPY --from=1 $SCRIPTS_FOLDER $SCRIPTS_FOLDER/
# Copy in app bundle with the built and installed dependencies from the previous image
COPY --from=1 $APP_BUNDLE_FOLDER/bundle $APP_BUNDLE_FOLDER/bundle/
# Start app
ENTRYPOINT ["/docker/entrypoint.sh"]
CMD ["node", "main.js"]
EXPOSE 3000
```
bash:
```bash
[+] Building 103.5s (17/22) docker:desktop-linux
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 1.96kB 0.0s
=> [internal] load metadata for docker.io/library/node:22.19.0-alpine 0.6s
=> [internal] load metadata for docker.io/geoffreybooth/meteor-base:3.3.2 0.6s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 106B 0.0s
=> [stage-0 1/9] FROM docker.io/geoffreybooth/meteor-base:3.3.2@sha256:f67aa3aaf08efb0117073a5f395fdf36eb255637d1ca81c66b9876fce 0.0s
=> [internal] load build context 0.0s
=> => transferring context: 23.02kB 0.0s
=> [stage-1 1/5] FROM docker.io/library/node:22.19.0-alpine@sha256:d2166de198f26e17e5a442f537754dd616ab069c47cc57b889310a717e0ab 0.0s
=> CACHED [stage-1 2/5] RUN apk --no-cache add bash g++ make python3 0.0s
=> CACHED [stage-2 2/4] RUN apk --no-cache add bash ca-certificates 0.0s
=> CACHED [stage-0 2/9] COPY ./package*.json /opt/src/ 0.0s
=> CACHED [stage-0 3/9] RUN bash /docker/build-app-npm-dependencies.sh 0.0s
=> CACHED [stage-0 4/9] RUN echo "SCRIPTS_FOLDER" 0.0s
=> CACHED [stage-0 5/9] RUN echo /docker 0.0s
=> CACHED [stage-0 6/9] RUN echo "APP_BUNDLE_FOLDER" 0.0s
=> CACHED [stage-0 7/9] RUN echo /opt/bundle 0.0s
=> [stage-0 8/9] COPY . /opt/src/ 0.1s
=> ERROR [stage-0 9/9] RUN bash /opt/src/build-meteor-bundle.sh 102.7s
------
> [stage-0 9/9] RUN bash /opt/src/build-meteor-bundle.sh:
0.134
0.134 [-] Building Meteor application bundle...
0.161
0.161 This container can use 6931M memory in total.
0.161 If it aborts with an out-of-memory (OOM) or ‘non-zero exit code 137’ error message,
0.161 please increase the container’s available memory.
0.162
0.162 See https://github.com/meteor/meteor/issues/9568 for details.
0.162
2.119
2.120 Even with METEOR_ALLOW_SUPERUSER or --allow-superuser, permissions in your app
2.120 directory will be incorrect if you ever attempt to perform any Meteor tasks as
2.120 a normal user. If you need to fix your permissions, run the following command
2.120 from the root of your project:
2.121
2.121 sudo chown -Rh <username> .meteor/local
2.121
39.32 ⚡ Setup jorgenvatle:vite v1.6.0-beta.2
39.32 ⚡ Setup meteor-vite v3.9.0-beta.1
39.32 ⚡ Setup meteor-vite is out of date! Try updating it: npm i meteor-vite@9.3
39.32 ⚡ Setup jorgenvatle:vite is out of date! Try updating it: meteor update jorgenvatle:vite
39.36 ⚡ Setup Cleaned up old build output in /opt/src/_vite-bundle/dist
39.36 ⚡ [PRODUCTION] Vite v6.4.0 (MeteorVite v3.9.0-beta.1 - undefined)
39.36 ⚡ [PRODUCTION] Resolving Vite config...
39.37
39.37
39.37 ⚡ Detected .meteorignore file.
39.37
39.37 Make sure that the paths within won't match any files within ./_vite-bundle as
39.37 this could lead to certain assets not being available in production.
39.37
39.37 Anything outside of this directory you're free to ignore, you can even ignore
39.37 source files as long as they are imported by your Vite entry module.
39.37
39.37 Add SUPPRESS_VITE_WARNINGS to your environment to suppress this warning.
39.37 Example: SUPPRESS_VITE_WARNINGS='some-warning,meteorignore,another-warning,etc'
39.37
39.37
39.38 (node:13) Warning: vm.USE_MAIN_CONTEXT_DEFAULT_LOADER is an experimental feature and might change at any time
39.38 (Use `node --trace-warnings ...` to show where the warning was created)
41.79 ⚡ [PRODUCTION] Building with Vite v6.4.0...
41.79 ⚡ Building packages to make them available to export analyzer...
99.25 ⚡ Packages built in 57,445ms
101.2 ⚡ [PRODUCTION] Preparing server bundle...
101.2 vite v6.4.0 building SSR bundle for production...
101.2 transforming...
102.1 ✓ 119 modules transformed.
102.2 rendering chunks...
102.3 _vite-bundle/dist/entry-server/main-BpkV3OIp.entry.js 102.03 kB │ map: 210.51 kB
102.3 ✓ built in 1.07s
102.3 ⚡ [PRODUCTION] Preparing client bundle...
102.3 vite v6.4.0 building for production...
102.3 transforming...
102.4 file:///opt/src/node_modules/meteor-vite/dist/chunk-PTULOKHP.mjs:1462
102.4 throw new MeteorViteStubRequestError(`Unable to read file content: ${fsError.message}`);
~/works/randuu.com/ [main*] docker build -f Dockerfile -t randuu-app .
[+] Building 120.1s (17/22) docker:desktop-linux
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 1.96kB 0.0s
=> [internal] load metadata for docker.io/library/node:22.19.0-alpine 1.0s
=> [internal] load metadata for docker.io/geoffreybooth/meteor-base:3.3.2 1.2s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 106B 0.0s
=> CACHED [stage-0 1/9] FROM docker.io/geoffreybooth/meteor-base:3.3.2@sha256:f67aa3aaf08efb0117073a5f395fdf36eb255637d1ca81c66b 0.0s
=> [stage-1 1/5] FROM docker.io/library/node:22.19.0-alpine@sha256:d2166de198f26e17e5a442f537754dd616ab069c47cc57b889310a717e0ab 0.0s
=> [internal] load build context 0.0s
=> => transferring context: 195.69kB 0.0s
=> CACHED [stage-1 2/5] RUN apk --no-cache add bash g++ make python3 0.0s
=> CACHED [stage-2 2/4] RUN apk --no-cache add bash ca-certificates 0.0s
=> [stage-0 2/9] COPY ./package*.json /opt/src/ 0.0s
=> [stage-0 3/9] RUN bash /docker/build-app-npm-dependencies.sh 13.6s
=> [stage-0 4/9] RUN echo "SCRIPTS_FOLDER" 0.1s
=> [stage-0 5/9] RUN echo /docker 0.2s
=> [stage-0 6/9] RUN echo "APP_BUNDLE_FOLDER" 0.1s
=> [stage-0 7/9] RUN echo /opt/bundle 0.1s
=> [stage-0 8/9] COPY . /opt/src/ 0.0s
=> ERROR [stage-0 9/9] RUN bash /opt/src/build-meteor-bundle.sh 104.6s
------
> [stage-0 9/9] RUN bash /opt/src/build-meteor-bundle.sh:
0.127
0.127 [-] Building Meteor application bundle...
0.154
0.154 This container can use 6931M memory in total.
0.154 If it aborts with an out-of-memory (OOM) or ‘non-zero exit code 137’ error message,
0.154 please increase the container’s available memory.
0.154
0.154 See https://github.com/meteor/meteor/issues/9568 for details.
0.154
2.191
2.192 Even with METEOR_ALLOW_SUPERUSER or --allow-superuser, permissions in your app
2.192 directory will be incorrect if you ever attempt to perform any Meteor tasks as
2.192 a normal user. If you need to fix your permissions, run the following command
2.192 from the root of your project:
2.192
2.193 sudo chown -Rh <username> .meteor/local
2.193
43.26 ⚡ Setup jorgenvatle:vite v1.6.0-beta.2
43.26 ⚡ Setup meteor-vite v3.9.0-beta.1
43.27 ⚡ Setup meteor-vite is out of date! Try updating it: npm i meteor-vite@9.3
43.27 ⚡ Setup jorgenvatle:vite is out of date! Try updating it: meteor update jorgenvatle:vite
43.29 ⚡ Setup Cleaned up old build output in /opt/src/_vite-bundle/dist
43.29 ⚡ [PRODUCTION] Vite v6.4.0 (MeteorVite v3.9.0-beta.1 - undefined)
43.29 ⚡ [PRODUCTION] Resolving Vite config...
43.30
43.30
43.30 ⚡ Detected .meteorignore file.
43.30
43.30 Make sure that the paths within won't match any files within ./_vite-bundle as
43.30 this could lead to certain assets not being available in production.
43.30
43.30 Anything outside of this directory you're free to ignore, you can even ignore
43.30 source files as long as they are imported by your Vite entry module.
43.30
43.30 Add SUPPRESS_VITE_WARNINGS to your environment to suppress this warning.
43.30 Example: SUPPRESS_VITE_WARNINGS='some-warning,meteorignore,another-warning,etc'
43.30
43.30
43.32 (node:13) Warning: vm.USE_MAIN_CONTEXT_DEFAULT_LOADER is an experimental feature and might change at any time
43.32 (Use `node --trace-warnings ...` to show where the warning was created)
45.61 ⚡ [PRODUCTION] Building with Vite v6.4.0...
45.61 ⚡ Building packages to make them available to export analyzer...
101.9 ⚡ Packages built in 56,321ms
103.3 ⚡ [PRODUCTION] Preparing server bundle...
103.3 vite v6.4.0 building SSR bundle for production...
103.4 transforming...
104.1 ✓ 119 modules transformed.
104.1 rendering chunks...
104.2 _vite-bundle/dist/entry-server/main-BpkV3OIp.entry.js 102.03 kB │ map: 210.51 kB
104.2 ✓ built in 843ms
104.2 ⚡ [PRODUCTION] Preparing client bundle...
104.2 vite v6.4.0 building for production...
104.2 transforming...
104.3 file:///opt/src/node_modules/meteor-vite/dist/chunk-PTULOKHP.mjs:1462
104.3 throw new MeteorViteStubRequestError(`Unable to read file content: ${fsError.message}`);
104.3 ^
104.3
104.3 MeteorViteStubRequestError: Unable to read file content: ENOENT: no such file or directory, open '/tmp/meteor-vite/out/src/bundle/programs/web.browser/packages/meteor.js'
104.3 at file:///opt/src/node_modules/meteor-vite/src/plugin/lib/ViteLoadRequest.ts:149:19 {
104.3 package: undefined,
104.3 context: undefined,
104.3 cause: undefined,
104.3 subtitle: undefined,
104.3 metadataLines: [],
104.3 originalMessage: "Unable to read file content: ENOENT: no such file or directory, open '/tmp/meteor-vite/out/src/bundle/programs/web.browser/packages/meteor.js'"
104.3 }
104.3
104.3 Node.js v22.18.0
------
1 warning found (use docker --debug to expand):
- InvalidBaseImagePlatform: Base image geoffreybooth/meteor-base:3.3.2 was pulled with platform "linux/amd64", expected "linux/arm64" for current build (line 2)
Dockerfile:17
--------------------
15 | COPY . $APP_SOURCE_FOLDER/
16 |
17 | >>> RUN bash $APP_SOURCE_FOLDER/build-meteor-bundle.sh
18 |
19 |
--------------------
ERROR: failed to build: failed to solve: process "/bin/sh -c bash $APP_SOURCE_FOLDER/build-meteor-bundle.sh" did not complete successfully: exit code: 1
View build details: docker-desktop://dashboard/build/desktop-linux/desktop-linux/qhv2pmhurzrd6mwmfsmtdwziq
~/works/randuu.com/ [main*]
```