Skip to content

๐Ÿ› BUG: โœ˜ [ERROR] Could not resolve "@cloudflare/pages-plugin-sentry"ย #1925

@aensley

Description

@aensley

What version of Wrangler are you using?

2.1.6

What operating system are you using?

Windows (Git Bash/MINGW)

Describe the Bug

Summary

I am unable to resolve any packages in Cloudflare workers despite them being listed on https://workers.cloudflare.com/works and working locally through wrangler.

I followed the official guide to integrate Sentry as middleware.

Repo/branch

https://github.com/aensley/liturgy-day/tree/add-sentry-2

Source

https://github.com/aensley/liturgy-day/blob/12f431856ec80533f29ffa5bc08320ad6dd7d464/functions/_middleware.ts#L1-L8

Build Error

09:39:43.463 | Cloning repository...
-- | --
09:39:44.397 | From https://github.com/aensley/liturgy-day
09:39:44.397 | * branch            12f431856ec80533f29ffa5bc08320ad6dd7d464 -> FETCH_HEAD
09:39:44.397 | ย 
09:39:44.443 | HEAD is now at 12f4318 add wrangler?
09:39:44.443 | ย 
09:39:44.551 | ย 
09:39:44.573 | Success: Finished cloning repository files
09:39:45.069 | No build command specified. Skipping build step.
09:39:45.559 | ๐Ÿšง 'wrangler pages <command>' is a beta command. Please report any issues to https://github.com/cloudflare/wrangler2/issues/new/choose
09:39:45.625 | โœ˜ [ERROR] Could not resolve "@cloudflare/pages-plugin-sentry"
09:39:45.625 | ย 
09:39:45.625 | ../../../buildhome/repo/functions/_middleware.ts:1:25:
09:39:45.625 | 1 โ”‚ import sentryPlugin from '@cloudflare/pages-plugin-sentry'
09:39:45.626 | โ•ต                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
09:39:45.626 | ย 
09:39:45.626 | You can mark the path "@cloudflare/pages-plugin-sentry" as external to exclude it from the bundle, which will remove this error.
09:39:45.627 | ย 
09:39:45.630 | 1 error(s) and 0 warning(s) when compiling Worker.
09:39:45.631 | ย 
09:39:45.718 | ๏ฟฝ[31mโœ˜ ๏ฟฝ[41;31m[๏ฟฝ[41;97mERROR๏ฟฝ[41;31m]๏ฟฝ[0m ๏ฟฝ[1mBuild failed with 1 error:๏ฟฝ[0m
09:39:45.718 | ย 
09:39:45.718 | ../../../buildhome/repo/functions/_middleware.ts:1:25: ERROR: Could not resolve "@cloudflare/pages-plugin-sentry"
09:39:45.718 | ย 
09:39:45.718 | ย 
09:39:45.718 | ๏ฟฝ[32mIf you think this is a bug then please create an issue at https://github.com/cloudflare/wrangler2/issues/new/choose๏ฟฝ[0m
09:39:45.727 | Failed building Pages Functions from /functions.
09:39:46.537 | Failed: an internal error occurred

Local output (successful)

image

me@my-computer MINGW64 ~/Workspaces/liturgy-day (add-sentry-2)
$ npx wrangler pages dev src --binding SENTRY_DSN="https://xxxxxxxxxxxxx@xxxxxxx.ingest.sentry.io/xxxxxxxxx" --binding ENVIRONMENT="local"
๐Ÿšง 'wrangler pages <command>' is a beta command. Please report any issues to https://github.com/cloudflare/wrangler2/issues/new/choose
Compiling worker to "C:\Users\me\AppData\Local\Temp\functionsWorker-0.9120506640895183.js"...
Compiled Worker successfully.
โ–ฒ [WARNING] Passing --inspect is unnecessary, now you can always connect to devtools.

โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ [b] open a browser, [d] open Devtools, [c] clear console, [x] to exit  โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
Debugger listening on ws://0.0.0.0:9229/972d75ea-2273-4625-8023-a5817c6a81ab
For help, see: https://nodejs.org/en/docs/inspector
[pages:wrn] Parsed 2 valid header rules.
[pages:wrn] Service bindings are experimental. There may be breaking changes in the future.
[pages:inf] Worker reloaded! (195.16KiB)
[pages:inf] Listening on 0.0.0.0:8788
[pages:inf] Updated `Request.cf` object cache!
GET /api/day/2022-09-26 200 OK (19.75ms)

Metadata

Metadata

Assignees

Labels

bugSomething that isn't workingpagesRelating to Pages

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions