ArDev
WWasp
•Created by ArDev on 12/21/2024 in #đŸ™‹questions
Wasp compile error
@kapa.ai 2024-12-24T17:53:29.953 app[3d8ddedb396d58] lhr [info] Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/app/.wasp/build/server/node_modules/wasp/server' imported from /app/.wasp/build/server/bundle/server.js
210 replies
WWasp
•Created by ArDev on 12/21/2024 in #đŸ™‹questions
Wasp compile error
@kapa.ai when doing wasp start everything works, but when doing fly deploy there are issues?
210 replies
WWasp
•Created by ArDev on 12/21/2024 in #đŸ™‹questions
Wasp compile error
@kapa.ai can you give me an example of a correct wasp/build foldeer
210 replies
WWasp
•Created by ArDev on 12/21/2024 in #đŸ™‹questions
Wasp compile error
@kapa.ai in my D:\AI Projects\wsl backup\yt new\app.wasp\build\server\node_modules i cant find the wasp folder?
210 replies
WWasp
•Created by ArDev on 12/21/2024 in #đŸ™‹questions
Wasp compile error
@kapa.ai 2024-12-24T11:59:41.311 app[3d8ddedb396d58] lhr [info] Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/app/.wasp/build/server/node_modules/wasp/universal/validators' imported from /app/.wasp/build/server/scripts/validate-env.mjs
210 replies
WWasp
•Created by ArDev on 12/21/2024 in #đŸ™‹questions
Wasp compile error
@kapa.ai give me the command to have detailed logging to fly deploy
210 replies
WWasp
•Created by ArDev on 12/21/2024 in #đŸ™‹questions
Wasp compile error
@kapa.ai [info] throw err;
2024-12-23T19:12:51.296 app[3d8ddedb396d58] lhr [info] ^
2024-12-23T19:12:51.296 app[3d8ddedb396d58] lhr [info] Error: Cannot find module '/app/.wasp/build/server/bundle/server.js'
210 replies
WWasp
•Created by ArDev on 12/21/2024 in #đŸ™‹questions
Wasp compile error
@kapa.ai Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/app/.wasp/build/server/node_modules/wasp/universal/validators' imported from /app/.wasp/build/server/scripts/validate-env.mjs
2024-12-23T19:10:34.174 app[3d8ddedb396d58] lhr [info] at finalizeResolution (node:internal/modules/esm/resolve:265:11)
2024-12-23T19:10:34.174 app[3d8ddedb396d58] lhr [info] at moduleResolve (node:internal/modules/esm/resolve:933:10)
2024-12-23T19:10:34.174 app[3d8ddedb396d58] lhr [info] at defaultResolve (node:internal/modules/esm/resolve:1169:11)
2024-12-23T19:10:34.174 app[3d8ddedb396d58] lhr [info] at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:542:12)
2024-12-23T19:10:34.174 app[3d8ddedb396d58] lhr [info] at ModuleLoader.resolve (node:internal/modules/esm/loader:510:25)
2024-12-23T19:10:34.174 app[3d8ddedb396d58] lhr [info] at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:239:38)
2024-12-23T19:10:34.174 app[3d8ddedb396d58] lhr [info] at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:96:40)
2024-12-23T19:10:34.174 app[3d8ddedb396d58] lhr [info] at link (node:internal/modules/esm/module_job:95:36) {
2024-12-23T19:10:34.174 app[3d8ddedb396d58] lhr [info] code: 'ERR_MODULE_NOT_FOUND',
2024-12-23T19:10:34.174 app[3d8ddedb396d58] lhr [info] url: 'file:///app/.wasp/build/server/node_modules/wasp/universal/validators'
210 replies
WWasp
•Created by ArDev on 12/21/2024 in #đŸ™‹questions
Wasp compile error
COPY .wasp/out/sdk /app/.wasp/out/sdk
@kapa.ai we can do this, but how to put it in the dockerfile? # Use the Wasp-generated Dockerfile as a base
FROM node:20 AS base
Copy the Wasp-generated files
COPY .wasp/build /app/.wasp/build
Set the working directory to where the package.json is located
WORKDIR /app/.wasp/build/server
Print the contents of package.json for verification
RUN cat package.json
Install dependencies including Prisma CLI
RUN npm install && npm install prisma --save-dev && npm install wasp
Add Prisma CLI to PATH
ENV PATH="/app/.wasp/build/server/node_modules/.bin:${PATH}"
ENV NODE_PATH=/app/.wasp/build/server/node_modules
Add any custom steps here
RUN echo "Custom build step"
Expose the port the app runs on
EXPOSE 8080
Start the app
CMD ["npm", "run", "start-production"]
210 replies
WWasp
•Created by ArDev on 12/21/2024 in #đŸ™‹questions
Wasp compile error
@kapa.ai throw new ERR_MODULE_NOT_FOUND(
2024-12-23T18:26:31.772 app[3d8ddedb396d58] lhr [info] ^
2024-12-23T18:26:31.772 app[3d8ddedb396d58] lhr [info] Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/app/.wasp/build/server/node_modules/wasp/universal/validators' imported from /app/.wasp/build/server/scripts/validate-env.mjs
2024-12-23T18:26:31.772 app[3d8ddedb396d58] lhr [info] at finalizeResolution (node:internal/modules/esm/resolve:265:11)
2024-12-23T18:26:31.772 app[3d8ddedb396d58] lhr [info] at moduleResolve (node:internal/modules/esm/resolve:933:10)
2024-12-23T18:26:31.772 app[3d8ddedb396d58] lhr [info] at defaultResolve (node:internal/modules/esm/resolve:1169:11)
2024-12-23T18:26:31.772 app[3d8ddedb396d58] lhr [info] at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:542:12)
2024-12-23T18:26:31.772 app[3d8ddedb396d58] lhr [info] at ModuleLoader.resolve (node:internal/modules/esm/loader:510:25)
2024-12-23T18:26:31.772 app[3d8ddedb396d58] lhr [info] at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:239:38)
2024-12-23T18:26:31.772 app[3d8ddedb396d58] lhr [info] at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:96:40)
2024-12-23T18:26:31.772 app[3d8ddedb396d58] lhr [info] at link (node:internal/modules/esm/module_job:95:36) {
2024-12-23T18:26:31.772 app[3d8ddedb396d58] lhr [info] code: 'ERR_MODULE_NOT_FOUND',
2024-12-23T18:26:31.772 app[3d8ddedb396d58] lhr [info] url: 'file:///app/.wasp/build/server/node_modules/wasp/universal/validators'
2024-12-23T18:26:31.772 app[3d8ddedb396d58] lhr [info] }
2024-12-23T18:26:31.772 app[3d8ddedb396d58] lhr [info] Node.js v20.18.1
210 replies
WWasp
•Created by ArDev on 12/21/2024 in #đŸ™‹questions
Wasp compile error
@kapa.ai 2024-12-23T18:23:27.077 app[3d8ddedb396d58] lhr [info] node:internal/modules/esm/resolve:854
2024-12-23T18:23:27.077 app[3d8ddedb396d58] lhr [info] throw new ERR_MODULE_NOT_FOUND(packageName, fileURLToPath(base), null);
2024-12-23T18:23:27.077 app[3d8ddedb396d58] lhr [info] ^
2024-12-23T18:23:27.077 app[3d8ddedb396d58] lhr [info] Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'wasp' imported from /app/.wasp/build/server/scripts/validate-env.mjs
210 replies
WWasp
•Created by ArDev on 12/21/2024 in #đŸ™‹questions
Wasp compile error
@kapa.ai now we get this -
2024-12-23T18:21:33.638 app[3d8ddedb396d58] lhr [info] > [email protected] start-production
2024-12-23T18:21:33.638 app[3d8ddedb396d58] lhr [info] > npm run db-migrate-prod && NODE_ENV=production npm run start
2024-12-23T18:21:33.780 app[3d8ddedb396d58] lhr [info] > [email protected] db-migrate-prod
2024-12-23T18:21:33.780 app[3d8ddedb396d58] lhr [info] > prisma migrate deploy --schema=../db/schema.prisma
2024-12-23T18:21:33.784 app[3d8ddedb396d58] lhr [info] sh: 1: prisma: not found
2024-12-23T18:21:34.037 proxy[3d8ddedb396d58] lhr [error] [PR04] could not find a good candidate within 21 attempts at load balancing
210 replies
WWasp
•Created by ArDev on 12/21/2024 in #đŸ™‹questions
Wasp compile error
@kapa.ai => ERROR [5/8] RUN npm install 0.5s
------
Set the working directory WORKDIR /app Install dependencies RUN npm install Add any custom steps here RUN echo "Custom build step" Expose the port the app runs on EXPOSE 8080 WORKDIR /app/.wasp/build/server RUN cat /app/.wasp/build/server/package.json Start the app CMD ["npm", "run", "start-production"]
[5/8] RUN npm install:0.520 npm error code ENOENT 0.520 npm error syscall open 0.520 npm error path /app/package.json 0.521 npm error errno -2 0.521 npm error enoent Could not read package.json: Error: ENOENT: no such file or directory, open '/app/package.json' 0.521 npm error enoent This is related to npm not being able to find a file. 0.521 npm error enoent 0.522 npm error A complete log of this run can be found in: /root/.npm/_logs/2024-12-23T18_18_34_795Z-debug-0.log ------ ==> Building image 1.1s
[5/8] RUN npm install:0.556 npm error code ENOENT 0.557 npm error syscall open 0.557 npm error path /app/package.json 0.557 npm error errno -2 0.557 npm error enoent Could not read package.json: Error: ENOENT: no such file or directory, open '/app/package.json' 0.558 npm error enoent This is related to npm not being able to find a file. 0.558 npm error enoent 0.559 npm error A complete log of t Use the Wasp-generated Dockerfile as a base FROM node:20 AS base Copy the Wasp-generated files COPY .wasp/build /app/.wasp/build RUN ls -R /app
Set the working directory WORKDIR /app Install dependencies RUN npm install Add any custom steps here RUN echo "Custom build step" Expose the port the app runs on EXPOSE 8080 WORKDIR /app/.wasp/build/server RUN cat /app/.wasp/build/server/package.json Start the app CMD ["npm", "run", "start-production"]
210 replies
WWasp
•Created by ArDev on 12/21/2024 in #đŸ™‹questions
Wasp compile error
@kapa.ai => ERROR [7/7] RUN cat /app/.wasp/build/server/package.json 0.1s
------
[7/7] RUN cat /app/.wasp/build/server/package.json:0.060 cat: /app/.wasp/build/server/package.json: No such file or directory ------ => CACHED [2/7] COPY .wasp/build/ /app/ 0.0s => CACHED [3/7] WORKDIR /app 0.0s => CACHED [4/7] RUN npm install 0.0s => CACHED [5/7] RUN echo "Custom build step" 0.0s => CACHED [6/7] WORKDIR /app/.wasp/build/server 0.0s => ERROR [7/7] RUN cat /app/.wasp/build/server/package.json 0.1s ------
210 replies
WWasp
•Created by ArDev on 12/21/2024 in #đŸ™‹questions
Wasp compile error
@kapa.ai in docker how to print the contnets of package.json cos i get a 2024-12-23T18:14:52.462 app[3d8ddedb396d58] lhr [info] npm error Missing script: "start-production"
with this docker file - # Use the Wasp-generated Dockerfile as a base
FROM node:20 AS base
Copy the Wasp-generated files
COPY .wasp/build/ /app/
Set the working directory
WORKDIR /app
Install dependencies
RUN npm install
Add any custom steps here
RUN echo "Custom build step"
Expose the port the app runs on
EXPOSE 8080
WORKDIR /app/.wasp/build/server
Start the app
CMD ["npm", "run", "start-production"]
210 replies
WWasp
•Created by ArDev on 12/21/2024 in #đŸ™‹questions
Wasp compile error
@kapa.ai jkp@DESKTOP-8S2VLLC:/usr/Projects/yt/app/.wasp/build$ flyctl deploy 2>&1 | tee deploy_log.txt
==> Verifying app config
Validating /usr/Projects/yt/app/.wasp/build/fly.toml
✓ Configuration is valid
--> Verified app config
==> Building image
Waiting for depot builder...
==> Building image with Depot
--> build: (​)
#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 1.82kB 0.1s done
#1 DONE 0.1s
#2 [internal] load metadata for docker.io/library/node:20-alpine
#2 DONE 0.6s
==> Building image
Waiting for depot builder...
==> Building image with Depot
--> build: (​)
#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 1.82kB 0.1s done
#1 DONE 0.1s
#2 [internal] load metadata for docker.io/library/node:20-alpine
#2 DONE 0.2s
Error: failed to fetch an image or build from source: error building: failed to solve: invalid containerPort: (ensure
210 replies
WWasp
•Created by ArDev on 12/21/2024 in #đŸ™‹questions
Wasp compile error
@kapa.ai jkp@DESKTOP-8S2VLLC:/usr/Projects/yt/app/.wasp/build$ flyctl deploy
==> Verifying app config
Validating /usr/Projects/yt/app/.wasp/build/fly.toml
✓ Configuration is valid
--> Verified app config
==> Building image
==> Building image with Depot
--> build: (​)
[+] Building 0.5s (2/2) FINISHED
=> [internal] load build definition from Dockerfile 0.1s => => transferring dockerfile: 1.82kB 0.1s => [internal] load metadata for docker.io/library/node:20-alpine 0.3s ==> Building image ==> Building image with Depot --> build: (​) [+] Building 0.2s (2/2) FINISHED
=> [internal] load build definition from Dockerfile 0.1s => => transferring dockerfile: 1.82kB 0.1s => [internal] load metadata for docker.io/library/node:20-alpine 0.1s Error: failed to fetch an image or build from source: error building: failed to solve: invalid containerPort: (ensure for some reason it gets cut offf
=> [internal] load build definition from Dockerfile 0.1s => => transferring dockerfile: 1.82kB 0.1s => [internal] load metadata for docker.io/library/node:20-alpine 0.3s ==> Building image ==> Building image with Depot --> build: (​) [+] Building 0.2s (2/2) FINISHED
=> [internal] load build definition from Dockerfile 0.1s => => transferring dockerfile: 1.82kB 0.1s => [internal] load metadata for docker.io/library/node:20-alpine 0.1s Error: failed to fetch an image or build from source: error building: failed to solve: invalid containerPort: (ensure for some reason it gets cut offf
210 replies
WWasp
•Created by ArDev on 12/21/2024 in #đŸ™‹questions
Wasp compile error
@kapa.ai sorry we get this now - Error: failed to fetch an image or build from source: error building: failed to solve: invalid containerPort: (ensure
210 replies
WWasp
•Created by ArDev on 12/21/2024 in #đŸ™‹questions
Wasp compile error
@kapa.ai thats fixed but now we get - RUN cat /app/.wasp/build/server/package.json
210 replies
WWasp
•Created by ArDev on 12/21/2024 in #đŸ™‹questions
Wasp compile error
@kapa.ai this is the fikle - {
"name": "server",
"version": "0.0.0",
"private": true,
"type": "module",
"comment-filip": "The server.js location changed because we have now included client source files above .wasp/out/server/src.",
"scripts": {
"bundle": "rollup --config --silent",
"start": "npm run validate-env && node --enable-source-maps -r dotenv/config bundle/server.js",
"bundle-and-start": "npm run bundle && npm run start",
"watch": "nodemon --exec 'npm run bundle-and-start || exit 1'",
"validate-env": "node -r dotenv/config ./scripts/validate-env.mjs",
"db-seed": "npm run bundle && node --enable-source-maps -r dotenv/config bundle/dbSeed.js",
"db-migrate-prod": "prisma migrate deploy --schema=../db/schema.prisma",
"start-production": "npm run db-migrate-prod && NODE_ENV=production npm run start"
},
"nodemonConfig": {
"delay": "1000"
},
"engineStrict": true,
"engines": {
"node": ">=18.18.0"
},
"prisma": {},
"dependencies": {"cookie-parser": "~1.4.6",
"cors": "^2.8.5",
"dotenv": "^16.0.2",
"express": "~4.21.0",
"helmet": "^6.0.0",
"morgan": "~1.10.0",
"superjson": "^2.2.1"
},
"devDependencies": {"@tsconfig/node18": "latest",
"@types/express-serve-static-core": "^4.17.13",
"@types/node": "^18.0.0",
"nodemon": "^2.0.19",
"rollup": "^4.9.6",
"rollup-plugin-esbuild": "^6.1.1"
}
}
210 replies