Akash Rajpurohit
Akash Rajpurohit
CDCloudflare Developers
Created by Akash Rajpurohit on 4/9/2024 in #pages-help
Wrangler CLI to push build for Git linked pages project
Basically I want to understand is there a way to link the Wrangler CLI to an existing git linked project, I don't seem to find any option on the CLI which can do it, it always asks for creating a new project. The reason I want this is because lately I've been seeing lots of build failures intermittently happening on pages (like this morning as well). In such cases where due to some upstream issue is pages build is not working, I could do a build on my system and just publish the dist directory, will that work? To test it I need to understand if the CLI allows linking projects in the first place.
1 replies
CDCloudflare Developers
Created by Akash Rajpurohit on 3/23/2024 in #pages-help
[Question] How are limits decided if I build the pages myself
Basically I want to understand how are the limits decided if I build the pages locally or on some CI server and the just push the artifacts to cloudflare to deploy? The limits (https://developers.cloudflare.com/pages/platform/limits/) states that "Each time you push new code to your Git repository, Pages will build and deploy your site. You can build up to 500 times per month on the Free plan." If I build it and just trigger a deployment based on the artifacts, does it account into the 500 builds per month?
3 replies
CDCloudflare Developers
Created by Akash Rajpurohit on 6/3/2023 in #pages-help
Failed to build Astro site while using @cloudflare/pages-plugin-sentry
Trying to integrate sentry plugin for cloudflare with astro and it is failing to build. The setup is like this
// middleware.ts
import sentryPlugin from '@cloudflare/pages-plugin-sentry';

export const onRequest = sentryPlugin({
dsn: 'sentry-dns',
});
// middleware.ts
import sentryPlugin from '@cloudflare/pages-plugin-sentry';

export const onRequest = sentryPlugin({
dsn: 'sentry-dns',
});
// astro.config.ts
{
output: 'hybrid',
experimental: {
hybridOutput: true,
middleware: true,
},
adapter: cloudflare({ mode: 'directory' }),
}
// astro.config.ts
{
output: 'hybrid',
experimental: {
hybridOutput: true,
middleware: true,
},
adapter: cloudflare({ mode: 'directory' }),
}
The error that I am getting it with the sentry package
prerendering static routes
(node:48390) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
/Users/akash/Documents/personal/akashrajpurohit.com/node_modules/.pnpm/@cloudflare+pages-plugin-sentry@1.1.1/node_modules/@cloudflare/pages-plugin-sentry/index.js:3344
export {
^^^^^^

SyntaxError: Unexpected token 'export'
at internalCompileFunction (node:internal/vm:73:18)
at wrapSafe (node:internal/modules/cjs/loader:1176:20)
at Module._compile (node:internal/modules/cjs/loader:1218:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
at Module.load (node:internal/modules/cjs/loader:1117:32)
at Module._load (node:internal/modules/cjs/loader:958:12)
at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:169:29)
at ModuleJob.run (node:internal/modules/esm/module_job:194:25) {
plugin: undefined,
hint: undefined
}

Node.js v18.16.0
 ELIFECYCLE  Command failed with exit code 1.
prerendering static routes
(node:48390) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
/Users/akash/Documents/personal/akashrajpurohit.com/node_modules/.pnpm/@cloudflare+pages-plugin-sentry@1.1.1/node_modules/@cloudflare/pages-plugin-sentry/index.js:3344
export {
^^^^^^

SyntaxError: Unexpected token 'export'
at internalCompileFunction (node:internal/vm:73:18)
at wrapSafe (node:internal/modules/cjs/loader:1176:20)
at Module._compile (node:internal/modules/cjs/loader:1218:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
at Module.load (node:internal/modules/cjs/loader:1117:32)
at Module._load (node:internal/modules/cjs/loader:958:12)
at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:169:29)
at ModuleJob.run (node:internal/modules/esm/module_job:194:25) {
plugin: undefined,
hint: undefined
}

Node.js v18.16.0
 ELIFECYCLE  Command failed with exit code 1.
Package versions:
"astro": "^2.5.7",
"@astrojs/cloudflare": "^6.3.0",
"@cloudflare/pages-plugin-sentry": "^1.1.1",
"astro": "^2.5.7",
"@astrojs/cloudflare": "^6.3.0",
"@cloudflare/pages-plugin-sentry": "^1.1.1",
4 replies