itaquito
itaquito
CDCloudflare Developers
Created by itaquito on 12/31/2024 in #pages-help
SvelteKit minimal template doesn't build at Cloudflare but works fine on my machine
Hello! I'm getting the following error when building a SvelteKit minimal app without any changes:
00:02:14.492 Installing project dependencies: npm clean-install --progress=false
00:02:15.393 npm error code EUSAGE
00:02:15.393 npm error
00:02:15.394 npm error `npm ci` can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing.
00:02:15.394 npm error
00:02:15.394 npm error Invalid: lock file's [email protected] does not satisfy [email protected]
00:02:15.394 npm error Missing: [email protected] from lock file
00:02:15.394 npm error Missing: [email protected] from lock file
00:02:15.394 npm error Missing: [email protected] from lock file
00:02:15.395 npm error
00:02:15.395 npm error Clean install a project
00:02:15.395 npm error
00:02:14.492 Installing project dependencies: npm clean-install --progress=false
00:02:15.393 npm error code EUSAGE
00:02:15.393 npm error
00:02:15.394 npm error `npm ci` can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing.
00:02:15.394 npm error
00:02:15.394 npm error Invalid: lock file's [email protected] does not satisfy [email protected]
00:02:15.394 npm error Missing: [email protected] from lock file
00:02:15.394 npm error Missing: [email protected] from lock file
00:02:15.394 npm error Missing: [email protected] from lock file
00:02:15.395 npm error
00:02:15.395 npm error Clean install a project
00:02:15.395 npm error
To reproduce this issue, you just need to create a SvelteKit minimal project with npx sv create my-app and select Typescript with Prettier, Eslint and TailwindCSS. I believe this is an issue with Cloudflare since I'm able to do npm ci in my machine without any issues. I also tried using the specific Node version I'm using in my machine, v22.12.0, on Cloudflare, but that didn't solve the issue. I first noticed this issue on my project when I update Svelte to v5. However, I noticed that the minimal app also has this issue. The deployment ID of the testing app is: c134ef57-9575-4f6a-b29c-a0fab939b511 Does anyone has any idea why this might be happening? Thanks.
3 replies
CDCloudflare Developers
Created by itaquito on 5/22/2024 in #workers-help
Workers with itty-router throws an error
Hello! I'm trying to use itty-router in a worker. However, an error is showing when I try to get a path.
X [ERROR] A hanging Promise was canceled. This happens when the worker runtime is waiting for a Promise from JavaScript to resolve, but has detected that the Promise cannot possibly ever resolve because all code and events related to the Promise's I/O context have already finished.


X [ERROR] Uncaught (in response) Error: The script will never generate a response.
X [ERROR] A hanging Promise was canceled. This happens when the worker runtime is waiting for a Promise from JavaScript to resolve, but has detected that the Promise cannot possibly ever resolve because all code and events related to the Promise's I/O context have already finished.


X [ERROR] Uncaught (in response) Error: The script will never generate a response.
This is my index.ts
import { Router } from 'itty-router';

const router = Router();

router.get('/', () => {
return new Response('Hello, world!');
});

router.all('*', () => new Response('404, not found!', { status: 404 }));

export default {
fetch: router.handle,
};
import { Router } from 'itty-router';

const router = Router();

router.get('/', () => {
return new Response('Hello, world!');
});

router.all('*', () => new Response('404, not found!', { status: 404 }));

export default {
fetch: router.handle,
};
Does anyone know why this might be happening?
15 replies
CDCloudflare Developers
Created by itaquito on 4/13/2024 in #general-help
Cloudflare Tunnel with virtual hosts
Hello! I just setup a Cloudflare Tunnel behind a CGNAT. To test, I made a public hostname and now I can see the default page of Nginx, so it works! Woo! In this same machine I have some virtual hosts made, phpmyadmin.debian.example.com and pterodactyl.debian.example.com. I have the DNS records of these subdomains pointed to the local IP of the machine. Everything works as expected, I can access both of the apps without any issue in my local network. Next I tried adding these applications to my tunnel. I created a new public hostname phpmyadmindebian.example.com and added this same hostname to my Nginx site configuration. However, I only see the default page of Nginx in this new public hostname. Does Cloudflare tunnel doesn't work with virtual hosts? Is there any extra configuration I need to do? Thanks for your help
9 replies