alex (he/him)
alex (he/him)
Explore posts from servers
CDCloudflare Developers
Created by alex (he/him) on 11/14/2023 in #pages-help
Help understanding routing with a custom `_routes.json`
Hey I'm debugging an user bug report for Astro. The user has the following _routes.json
{
"version": 1,
"include": [
"/404",
"/_image"
],
"exclude": []
}
{
"version": 1,
"include": [
"/404",
"/_image"
],
"exclude": []
}
And the following file-tree:
dist
├── _redirects
├── _routes.json
├── _worker.js
├── favicon.svg
└── index.html
dist
├── _redirects
├── _routes.json
├── _worker.js
├── favicon.svg
└── index.html
If he now tries to access his webpage using the following url: https://example.com/unknown, the index.html is returned. Would like to understand the why, so we can offer a fix in Astro?
12 replies
CDCloudflare Developers
Created by alex (he/him) on 10/20/2023 in #pages-help
`pages.dev` is limited compared to custom domain
We have enabled CF Fonts & CF Image Resizing on a zone, which also is setup as a custom domain for our pages project. That works fine for the main production branch. However accessing the preview deployments at hash.pages.dev, both system do not work. What is the best way to make them work with the pages.dev urls, or get individual preview urls on the custom domain automatically?
6 replies
CDCloudflare Developers
Created by alex (he/him) on 7/3/2023 in #pages-help
`rss.xml` Error 1101
trying to access: https://baae285e.test-ef9.pages.dev/rss.xml But get strange issue, can someone help?
{
"outcome": "exception",
"scriptName": "pages-worker--1063707-production",
"exceptions": [
{
"name": "Error",
"message": "internal error",
"timestamp": 1688404914662
}
],
"logs": [],
"eventTimestamp": 1688404914662,
"event": {
"request": {
"url": "https://baae285e.test-ef9.pages.dev/rss.xml",
"method": "GET",
"headers": {
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
"accept-encoding": "gzip",
"accept-language": "en-US,en;q=0.9,de;q=0.8",
"cache-control": "max-age=0",
"cf-connecting-ip": "31.17.112.38",
"cf-ipcountry": "DE",
"cf-ray": "7e10cebc98ffcad1",
"cf-visitor": "{\"scheme\":\"https\"}",
"connection": "Keep-Alive",
"dnt": "1",
"host": "baae285e.test-ef9.pages.dev",
"priority": "u=0, i",
"sec-ch-ua": "\"Not.A/Brand\";v=\"8\", \"Chromium\";v=\"114\"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": "\"macOS\"",
"sec-fetch-dest": "document",
"sec-fetch-mode": "navigate",
"sec-fetch-site": "none",
"sec-fetch-user": "?1",
"upgrade-insecure-requests": "1",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
"x-forwarded-proto": "https",
"x-real-ip": "31.17.112.38"
},
},
"response": {
"status": 500
}
},
"id": 2
}
{
"outcome": "exception",
"scriptName": "pages-worker--1063707-production",
"exceptions": [
{
"name": "Error",
"message": "internal error",
"timestamp": 1688404914662
}
],
"logs": [],
"eventTimestamp": 1688404914662,
"event": {
"request": {
"url": "https://baae285e.test-ef9.pages.dev/rss.xml",
"method": "GET",
"headers": {
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
"accept-encoding": "gzip",
"accept-language": "en-US,en;q=0.9,de;q=0.8",
"cache-control": "max-age=0",
"cf-connecting-ip": "31.17.112.38",
"cf-ipcountry": "DE",
"cf-ray": "7e10cebc98ffcad1",
"cf-visitor": "{\"scheme\":\"https\"}",
"connection": "Keep-Alive",
"dnt": "1",
"host": "baae285e.test-ef9.pages.dev",
"priority": "u=0, i",
"sec-ch-ua": "\"Not.A/Brand\";v=\"8\", \"Chromium\";v=\"114\"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": "\"macOS\"",
"sec-fetch-dest": "document",
"sec-fetch-mode": "navigate",
"sec-fetch-site": "none",
"sec-fetch-user": "?1",
"upgrade-insecure-requests": "1",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
"x-forwarded-proto": "https",
"x-real-ip": "31.17.112.38"
},
},
"response": {
"status": 500
}
},
"id": 2
}
7 replies
DTDrizzle Team
Created by alex (he/him) on 6/19/2023 in #help
drizzle-kit@win still not working. What am I doing wrong?
/Users/alexanderniebuhr/Developer/Projects/alexanderniebuhr_blog/packages/db/drizzle.config.ts
import type { Config } from 'drizzle-kit'

export default {
schema: './src/schema/*.ts',
out: './drizzle',
} satisfies Config
import type { Config } from 'drizzle-kit'

export default {
schema: './src/schema/*.ts',
out: './drizzle',
} satisfies Config
❯ moon run db:generate
▪▪▪▪ db:generate
drizzle-kit: v0.19.2
drizzle-orm: v0.27.0

No config path provided, using default 'drizzle.config.ts'
Reading config file '/Users/alexanderniebuhr/Developer/Projects/alexanderniebuhr_blog/packages/db/drizzle.config.ts'
node:internal/errors:496
ErrorCaptureStackTrace(err);
^

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/alexanderniebuhr/Developer/Projects/alexanderniebuhr_blog/packages/db/drizzle.config.ts__drizzle__' imported from /Users/alexanderniebuhr/Developer/Projects/alexanderniebuhr_blog/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/index.cjs
at new NodeError (node:internal/errors:405:5)
at finalizeResolution (node:internal/modules/esm/resolve:224:11)
at moduleResolve (node:internal/modules/esm/resolve:837:10)
at defaultResolve (node:internal/modules/esm/resolve:1035:11)
at DefaultModuleLoader.resolve (node:internal/modules/esm/loader:269:12)
at DefaultModuleLoader.getModuleJob (node:internal/modules/esm/loader:153:32)
at DefaultModuleLoader.import (node:internal/modules/esm/loader:245:28)
at importModuleDynamically (node:internal/modules/cjs/loader:1185:37)
at importModuleDynamicallyWrapper (node:internal/vm/module:428:21)
at importModuleDynamically (node:internal/vm:105:46) {
code: 'ERR_MODULE_NOT_FOUND'
}

Node.js v20.3.0
▪▪▪▪ db:generate (97ms)
Error: × Process drizzle-kit failed with a 1 exit code.
❯ moon run db:generate
▪▪▪▪ db:generate
drizzle-kit: v0.19.2
drizzle-orm: v0.27.0

No config path provided, using default 'drizzle.config.ts'
Reading config file '/Users/alexanderniebuhr/Developer/Projects/alexanderniebuhr_blog/packages/db/drizzle.config.ts'
node:internal/errors:496
ErrorCaptureStackTrace(err);
^

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/alexanderniebuhr/Developer/Projects/alexanderniebuhr_blog/packages/db/drizzle.config.ts__drizzle__' imported from /Users/alexanderniebuhr/Developer/Projects/alexanderniebuhr_blog/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/index.cjs
at new NodeError (node:internal/errors:405:5)
at finalizeResolution (node:internal/modules/esm/resolve:224:11)
at moduleResolve (node:internal/modules/esm/resolve:837:10)
at defaultResolve (node:internal/modules/esm/resolve:1035:11)
at DefaultModuleLoader.resolve (node:internal/modules/esm/loader:269:12)
at DefaultModuleLoader.getModuleJob (node:internal/modules/esm/loader:153:32)
at DefaultModuleLoader.import (node:internal/modules/esm/loader:245:28)
at importModuleDynamically (node:internal/modules/cjs/loader:1185:37)
at importModuleDynamicallyWrapper (node:internal/vm/module:428:21)
at importModuleDynamically (node:internal/vm:105:46) {
code: 'ERR_MODULE_NOT_FOUND'
}

Node.js v20.3.0
▪▪▪▪ db:generate (97ms)
Error: × Process drizzle-kit failed with a 1 exit code.
6 replies
DTDrizzle Team
Created by alex (he/him) on 6/4/2023 in #help
Type Declaration with TypeScript in Monorepo failes
I am trying to setup a monorepo with moon and pnpm, where shema lives in an additional package and is imported by other apps. Is there any monorepo example? Currently I get following error:
../db/src/schema/products.ts(4,14): error TS2742: The inferred type of 'products' cannot be named without a reference to '../../node_modules/drizzle-orm/db.d-a6fe1b19.js'. This is likely not portable. A type annotation is necessary.
../db/src/schema/products.ts(4,14): error TS2742: The inferred type of 'products' cannot be named without a reference to '../../node_modules/drizzle-orm/db.d-a6fe1b19.js'. This is likely not portable. A type annotation is necessary.
There is an GitHub Issue already, can anyone help with workarounds or fixes, explanations? https://github.com/drizzle-team/drizzle-orm/issues/656
6 replies