xmatthias
xmatthias
NNuxt
Created by xmatthias on 8/18/2024 in #❓・help
Nitro scheduledTask cloudflare
I've got a nuxt app deployed via git integration into cloudflare (it's essentially zero config other than a few environment variables and changing the command from npm run build to pnpm run build). Now i've tried to add a scheduledTask to it - and it works fine in dev mode (it's triggering as configured) - but the deployment part of this is unclear to me, and doesn't seem to work just yet.
nitro: {
experimental: {
tasks: true,
},
scheduledTasks: {
'* * * * *': ['test:scheduler'],
},
},
nitro: {
experimental: {
tasks: true,
},
scheduledTasks: {
'* * * * *': ['test:scheduler'],
},
},
The build-log on cloudflare doesn't mention anything about tasks (other than the file that was built) - and i don't see any trace of the function being executed.
[info] [nitro] Building Nuxt Nitro server (preset: cloudflare-pages)
Nitro seems to use the correct preset - and i don't have a wrangler.toml file present - as the regular nuxt deployment works without it. Am i missing a step here? or is deployment to cloudflare not working out of the box just yet?
2 replies
NNuxt
Created by xmatthias on 8/6/2024 in #❓・help
eslint with layers confusion
I'm using eslint in a project with multiple apps and layers (app, common-ui, landingpage, ...) - each managed through pnpm workspace. in the current, non-flatconfig setup, i've got a eslint.config at the top - configuring the rules for all projects - which eslint detects and follows. How'd that work with the new withNuxt() approach? in my understanding, that's imported from .nuxt/ - which doesn't exist at the top level though - but only within each directory. Do i need to pick one "main" project and import from ./app/.nuxt/... ? or am i missing something?
1 replies
NNuxt
Created by xmatthias on 4/14/2024 in #❓・help
@nuxtjs/supabase deploy problem on cloudflare
I've got a problem with a nuxt project, which doesn't seem to deploy on cloudflare the moment @nuxt/supabase is added to the project. The deployment always ends with the following lines:
20:19:18.601 ✨ Compiled Worker successfully
20:19:18.655 Found _routes.json in output directory. Uploading.
20:19:18.668 Validating asset output directory
20:19:27.353 Success: Assets published!
20:19:28.628 Error: Failed to publish your Function. Got error: Uncaught ReferenceError: global is not defined
at chunks/runtime.mjs:1:30918
20:19:18.601 ✨ Compiled Worker successfully
20:19:18.655 Found _routes.json in output directory. Uploading.
20:19:18.668 Validating asset output directory
20:19:27.353 Success: Assets published!
20:19:28.628 Error: Failed to publish your Function. Got error: Uncaught ReferenceError: global is not defined
at chunks/runtime.mjs:1:30918
Interestingly, this is only happening when using pnpm. the same exact project/setup with yarn does seem to work just fine. All dependencies and pnpm are uptodate - and all issues i found about this are from mid-2023 - which i'd hope would've removed this in the meantime. --- An very minimal example project is here: https://github.com/xmatthias/nuxt_supabase_deploy_test as the commit history shows - i did experiment quite a bit with it ...
3 replies