rufi
rufi
CDCloudflare Developers
Created by rufi on 9/24/2024 in #wrangler
Hello!
I think I found the problem. I had a previous version of the worker that specified the custom domains. but if I only do { pattern = "sub.mysite.io/*", zone_name = "mysite.io" }, it seems to work fine (may not need to specify the custom_domain one in this case)
1 replies
CDCloudflare Developers
Created by MD AMIR SOHAIL on 11/24/2023 in #workers-help
Issue with Cors Header Blocking : Cloudflare Worker.
are you sure it's a CORS issue or basically the root issue could be that the ActionDetailsComponent fails at some point (it mentions undefined properties)? If there is this kind of error, it would appear as a CORS issue but it's not the underlaying problem
3 replies
CDCloudflare Developers
Created by rufi on 11/25/2023 in #workers-help
wranger 3.15.0+ I get getaddrinfo ENOTFOUND using unstable_dev
Full error log is
Retrieving cached values for userId from node_modules/.cache/wrangler
...
▲ [WARNING] No compatibility_date was specified. Using the installed Workers runtime's latest supported date: 2023-10-30.
...
disableDevRegistry: false
-- START CF API REQUEST: GET https://api.cloudflare.com/client/v4/accounts/XXX/workers/subdomain/edge-preview
HEADERS: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
INIT: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
-- END CF API REQUEST
-- START CF API RESPONSE: OK 200
HEADERS: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
RESPONSE: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
-- END CF API RESPONSE
-- START EXCHANGE API REQUEST: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
-- END EXCHANGE API REQUEST
-- START EXCHANGE API RESPONSE: OK 200
HEADERS: {}
RESPONSE: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
-- END EXCHANGE API RESPONSE
Total Upload: 44.79 KiB / gzip: 10.67 KiB
-- START CF API REQUEST: POST https://api.cloudflare.com/client/v4/accounts/XXX/workers/scripts/XXX/edge-preview
HEADERS: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
INIT: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
-- END CF API REQUEST
-- START CF API RESPONSE: OK 200
HEADERS: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
RESPONSE: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
-- END CF API RESPONSE
Checking if domain has Access enabled: XXX.XXX.workers.dev
Access switch not cached for: XXX.XXX.workers.dev
Caching access switch for: XXX.XXX.workers.dev
PREVIEW URL: https://7b9ec9e5ace34ccfxxx.XXX.workers.dev
✘ [ERROR] 3:28:53 PM Error: getaddrinfo ENOTFOUND *

at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26) {
errno: -3008,
code: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: '*'
}
Retrieving cached values for userId from node_modules/.cache/wrangler
...
▲ [WARNING] No compatibility_date was specified. Using the installed Workers runtime's latest supported date: 2023-10-30.
...
disableDevRegistry: false
-- START CF API REQUEST: GET https://api.cloudflare.com/client/v4/accounts/XXX/workers/subdomain/edge-preview
HEADERS: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
INIT: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
-- END CF API REQUEST
-- START CF API RESPONSE: OK 200
HEADERS: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
RESPONSE: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
-- END CF API RESPONSE
-- START EXCHANGE API REQUEST: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
-- END EXCHANGE API REQUEST
-- START EXCHANGE API RESPONSE: OK 200
HEADERS: {}
RESPONSE: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
-- END EXCHANGE API RESPONSE
Total Upload: 44.79 KiB / gzip: 10.67 KiB
-- START CF API REQUEST: POST https://api.cloudflare.com/client/v4/accounts/XXX/workers/scripts/XXX/edge-preview
HEADERS: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
INIT: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
-- END CF API REQUEST
-- START CF API RESPONSE: OK 200
HEADERS: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
RESPONSE: omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data
-- END CF API RESPONSE
Checking if domain has Access enabled: XXX.XXX.workers.dev
Access switch not cached for: XXX.XXX.workers.dev
Caching access switch for: XXX.XXX.workers.dev
PREVIEW URL: https://7b9ec9e5ace34ccfxxx.XXX.workers.dev
✘ [ERROR] 3:28:53 PM Error: getaddrinfo ENOTFOUND *

at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26) {
errno: -3008,
code: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: '*'
}
3 replies
CDCloudflare Developers
Created by rufi on 11/25/2023 in #workers-help
wranger 3.15.0+ I get getaddrinfo ENOTFOUND using unstable_dev
my wrangler.toml has been totally commented out to debug. (So it's really minimal.) I use this function to create the worker:
const createWorker = async () => {
try {
const worker = await unstable_dev('src/main.js', {
experimental: {
disableExperimentalWarning: true,
},
logLevel: 'debug',
local: false,
});

return worker;
} catch (error) {
console.error('Error creating worker:', error);
console.error(error.stack);
throw error;
}
};
const createWorker = async () => {
try {
const worker = await unstable_dev('src/main.js', {
experimental: {
disableExperimentalWarning: true,
},
logLevel: 'debug',
local: false,
});

return worker;
} catch (error) {
console.error('Error creating worker:', error);
console.error(error.stack);
throw error;
}
};
To run this I use - npx cucumber-js This points to steps implementations that contain
BeforeAll(async () => {
state.worker = await createWorker();
});
BeforeAll(async () => {
state.worker = await createWorker();
});
3 replies