Successor1
05/02/2023, 12:10 PMwrangler publish
in terminal, the app successfully deploys but when I try to do it through github worker, it doesn't. This broke after I've installed toucan.js to get some sentry monitoring in my worker. The failing step in .github/workflows/main.yml
is :
deploy:
needs: run-tests
runs-on: ubuntu-latest
name: Deploy
steps:
- uses: actions/checkout@v2
- name: Publish
uses: cloudflare/wrangler-action@2.0.0
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
The error it throws is:
✘ [ERROR] Could not resolve "toucan-js"
src/index.ts:53:23:
53 │ import { Toucan } from 'toucan-js';
╵ ~~~~~~~~~~~
You can mark the path "toucan-js" as external to exclude it from the bundle, which will remove this error.
Before that I didn't have any external dependency and my package.json is:
{
"name": "name",
"version": "0.0.0",
"devDependencies": {
"@cloudflare/workers-types": "^3.18.0",
"@jest/globals": "^29.5.0",
"@types/jest": "^29.2.2",
"@types/node": "^18.11.9",
"@typescript-eslint/eslint-plugin": "^5.59.2",
"@typescript-eslint/parser": "^5.59.2",
"eslint": "^8.39.0",
"ts-jest": "^29.1.0",
"typescript": "^4.8.4",
"wrangler": "^2.18.0"
},
"private": true,
"scripts": {
"dev": "wrangler dev",
"deploy": "wrangler publish",
"test": "jest",
"lint": "eslint . --ext .ts"
},
"dependencies": {
"toucan-js": "^3.1.0"
}
}
Any idea what am I doing wrong? How can I mark toucan-js
as external?kian
05/02/2023, 12:14 PMnpm install
?kian
05/02/2023, 12:14 PMnpm ci
Successor1
05/02/2023, 12:15 PMkian
05/02/2023, 12:16 PMpreCommands: npm ci
below your apiToken
under with
kian
05/02/2023, 12:16 PMnpm ci
if you have a package.json lockfile committed, npm install
if not)Successor1
05/02/2023, 12:17 PMSuccessor1
05/02/2023, 12:17 PMdeploy:
needs: run-tests
runs-on: ubuntu-latest
name: Deploy
steps:
- uses: actions/checkout@v2
- run: npm ci
- name: Publish
uses: cloudflare/wrangler-action@2.0.0
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
kian
05/02/2023, 12:18 PMSuccessor1
05/02/2023, 12:18 PM