Closed mnlbox closed 7 months ago
Thank you! I'll check this one in the evening.
Yes, it is one of the supported arguments.
export interface DeployExecutorSchema {
name: string;
noBundle: boolean;
env: string;
outdir: string;
compatibilityDate: string;
compatibilityFlags: string[];
latest: boolean;
assets: string;
site: string;
siteInclude: string[];
siteExclude: string[];
var: string[];
define: string[];
triggers: string[];
routes: string[];
tsconfig: string;
minify: boolean;
nodeCompat: boolean;
dryRun: boolean;
keepVars: boolean;
}
I understand the problem.
publish
and deploy
are aliases, but only for the executor. For example:
"executor": "@naxodev/nx-cloudflare:deploy"
is the same as
"executor": "@naxodev/nx-cloudflare:publish"
however, we are generating the applications with deploy as the command name, which is causing the confussion
"deploy": {
"executor": "@naxodev/nx-cloudflare:deploy"
}
so the options here are either change the docs to use deploy
or change the generator to use publish
Since wrangler publish
has been deprecated, I will move everything to deploy. But you can use it right now.
@NachoVazquez Thanks for the update, I tried this command: pnpm nx deploy api-test
. And this is the output:
> nx run api-test:deploy
⛅️ wrangler 3.49.0
-------------------
▲ [WARNING] Using the latest version of the Workers runtime. To silence this warning, please choose a specific version of the runtime with --compatibility-date, or add a compatibility_date to your wrangler.toml.
✘ [ERROR] In a non-interactive environment, it's necessary to set a CLOUDFLARE_API_TOKEN environment variable for wrangler to work. Please go to https://developers.cloudflare.com/fundamentals/api/get-started/create-token/ for instructions on how to create an api token, and assign its value to CLOUDFLARE_API_TOKEN.
🪵 Logs were written to "/home/node/.config/.wrangler/logs/wrangler-2024-04-11_13-43-49_985.log"
————————————————————————————————————————————————————————————————————————————————————————————————————————————
NX Ran target deploy for project api-test (3s)
✖ 1/1 failed
✔ 0/1 succeeded [0 read from cache]
So I think it will work after setting the CLOUDFLARE_API_KEY. I'll check with API_KEY and will inform you here.
@NachoVazquez the deploy command also seems working but it return the below warning:
pnpm nx run service-test:deploy
> nx run service-test:deploy
⛅️ wrangler 3.50.0 (update available 3.51.0)
-------------------------------------------------------
▲ [WARNING] Using the latest version of the Workers runtime. To silence this warning, please choose a specific version of the runtime with --compatibility-date, or add a compatibility_date to your wrangler.toml.
✘ [ERROR] In a non-interactive environment, it's necessary to set a CLOUDFLARE_API_TOKEN environment variable for wrangler to work. Please go to https://developers.cloudflare.com/fundamentals/api/get-started/create-token/ for instructions on how to create an api token, and assign its value to CLOUDFLARE_API_TOKEN.
🪵 Logs were written to "/home/node/.config/.wrangler/logs/wrangler-2024-04-17_07-14-51_645.log"
———————————————————————————————————————————————————————————————————————————————————————————————————————————————
NX Ran target deploy for project service-test (3s)
✖ 1/1 failed
✔ 0/1 succeeded [0 read from cache]
I think maybe a bit more information and guide or a "how to deploy" section in README is also useful. But I'm new in CloudFlare so I guess by some research I can do it.
You need to set the Cloudflare API key in your env variables. I might make a note on the docs. However, this is needed for any Cloudflare project beyond this plugin.
Current Behavior
When I run my project through the
publish
command I'm getting this error in my terminal:Expected Behavior
It's just a helloworld application based on Hono. Do I missed anything in my
wrangler.toml
file? What should I do to fix this and deploy and publish my worker? Maybe a more clear error message can be helpful here.GitHub Repo
No response
Steps to Reproduce
Create my project with this command:
Then run my project with this command:
I can run my project sucessfully but I'm getting this error on
publish
:Nx Report
Failure Logs
No response
Operating System
Additional Information
I'm using vscode devContainer with a Debian based linux in a MacOs host machine.