-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrangler is reinstalled even when it's already available #199
Comments
+1 but also wanted to mention that not having the option to disabling this install is preventing my team from using this action because of the hugely increased runtime. The action runs |
I've recently moved all my projects to use |
@petebacondarwin Please reopen this issue due to #265. |
@AdiRishi Thanks for your contribution. However, I am currently facing some issues with my project setup. My project uses yarn workspaces. Even though I have executed // "package.json" in workspace root
{
"name": "sony-pages",
"workspaces": [
"apps/*"
],
"version": "0.0.0",
"private": true,
"scripts": {
"deploy": "wrangler deploy",
"dev": "wrangler dev",
"start": "wrangler dev",
"test": "vitest"
},
"devDependencies": {
"@cloudflare/kv-asset-handler": "^0.3.3",
"@cloudflare/workers-types": "^4.20240620.0",
"lerna": "^8.1.5",
"typescript": "^5.0.4",
"vitest": "1.3.0",
"wrangler": "^3.61.0"
},
"dependencies": {}
} // the workflow yml
name: Deploy
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
name: Deploy
steps:
- uses: actions/checkout@v4
- name: Build
run: |
bash ./build.sh
- name: Deploy to cloudflare
uses: cloudflare/[email protected]
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
- name: Lark bot notify
run: |
curl -X POST \
-H "Content-Type: application/json" \
... Do you know what could be the reason for this? Below is a screenshot of the results from my workflow execution. |
Delete 'workspaces' field in package.json is one solution: name: Deploy
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
name: Deploy
steps:
- uses: actions/checkout@v4
- name: Build
run: |
bash ./build.sh
+ - name: Delete 'workspaces' field
+ run: |
+ jq 'del(.workspaces)' package.json > temp.json
+ mv temp.json package.json
+ cat package.json
- name: Deploy to cloudflare
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
- name: Lark bot notify
run: |
curl -X POST \
-H "Content-Type: application/json" \
....... |
Also running into this issue. |
@wqcstrong i think you are running into the issue i documented in #277. for now, i just pinned the version in my workflow file ( |
Same issue :(
|
Running into this issue too. Run cloudflare/wrangler-action@v3
🔍 Checking for existing Wrangler installation
/usr/local/bin/yarn wrangler --version
yarn run v1.22.10
$ /home/runner/work/site-us/site-us/nextjs/node_modules/.bin/wrangler --version
3.79.0
Done in 0.66s.
⚠️ Wrangler not found or version is incompatible. Installing... |
Ran into an issue related to this for a project with honox Since an old version is installed, the vite build fails with a commonJS error. This error seems to be related to an issue with this older version of wrangler, and I could resolve it by specifying a current wrangler version (3.80.0): bun run build
$ vite build --mode client && vite build
failed to load config from /home/runner/work/RateThatIssue/RateThatIssue/vite.config.ts
error during build:
file:///home/runner/work/RateThatIssue/RateThatIssue/node_modules/@hono/vite-dev-server/dist/adapter/cloudflare.js:2
import { getPlatformProxy } from "wrangler";
^^^^^^^^^^^^^^^^
SyntaxError: Named export 'getPlatformProxy' not found. The requested module 'wrangler' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from 'wrangler';
const { getPlatformProxy } = pkg; |
Same issue here.
|
…workflow step configuration until cloudflare/wrangler-action#199 is fixed
Currently,
wrangler-action
always installs wrangler as specified by thewranglerVersion
input or theDEFAULT_WRANGLER_VERSION
constant contained in the source. This isn't always necessary as Wrangler may have already been installed in a previous step of the workflow (e.g. if it's declared in the project's dependencies inpackage.json
). This also makes it harder to keep the version of Wrangler used bywrangler-action
and the version used locally consistent, as the user needs to manually keepwranglerVersion
andpackage.json
in sync.Instead, we should only install Wrangler if it's not already present in the
$PATH
(including the package manager bin directory) OR ifwranglerVersion
has been explicitly providedThe text was updated successfully, but these errors were encountered: