You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 23.4.0: Wed Feb 21 21:44:43 PST 2024; root:xnu-10063.101.15~2/RELEASE_ARM64_T6000
CPU: (10) arm64 Apple M1 Pro
Memory: 16 GB
Shell: /bin/zsh
Package Manager Used: npm (10.2.4)
Relevant Packages:
@cloudflare/next-on-pages: 1.11.0
vercel: 34.0.0
next: 14.1.0
Description
In package.json installed version of eslint is ^8, but the rule that uses context.filename returns undefined.
Installing eslint^8.43.0 resolved the issue, used the same version as specified in package.json of the eslint plugin repository.
Reproduction
Run pnpm create cloudflare@latest
Setup a next.js project with eslint plugin next-on-pages
Run pnpm run lint, will show something like Error while loading rule 'next-on-pages/no-unsupported-configs': Cannot read properties of undefined (reading 'match')
Pages Deployment Method
None
Pages Deployment ID
No response
Additional Information
No response
Would you like to help?
Would you like to help fixing this bug?
The text was updated successfully, but these errors were encountered:
Unfortunately I could not reproduce this on my end, neither with npm (npm create cloudflare + npm run lint) nor pnpm (pnpm create cloudflare + pnpm run lint)...
I have seen issues like Cannot read properties of undefined (reading 'match') when trying to use a project with a package manager different from the one used to install dependencies.... could have you accidentally fallen into that scenario?
Interestingly your info command does say Package Manager Used: npm (10.2.4) although you're referring to pnpm commands in the PR's description 馃
Could you try again from zero and making sure to use the exact same package manager for both installation and running the lint script? could you try this with both npm and pnpm? 馃檹
Will try running script from zero again and update here; but the command I used was npx instead of pnpm dlx,
Version of pnpm output when I ran pnpm dlx @cloudflare/next-on-pages is 8.5.1
It worked with npm, eslint version installed is v8.57.0
But with pnpm, eslint version is v8.0.0
Looks like pnpm resolves semver ^8.0.0 to lowest available version.
Oof, its a skill issue on my end. Dependencies installed are correct or as expected on latest pnpm version.
I bootstraped a cloudflare next.js project again with pnpm version 9.0.6 and ran pnpm run lint it worked nicely :)
Will create a PR to add some documentation for people who wants to use pnpm
next-on-pages environment related information
Description
In
package.json
installed version ofeslint
is^8
, but the rule that usescontext.filename
returns undefined.Installing
eslint
^8.43.0
resolved the issue, used the same version as specified inpackage.json
of the eslint plugin repository.Reproduction
pnpm create cloudflare@latest
next-on-pages
pnpm run lint
, will show something likeError while loading rule 'next-on-pages/no-unsupported-configs': Cannot read properties of undefined (reading 'match')
Pages Deployment Method
None
Pages Deployment ID
No response
Additional Information
No response
Would you like to help?
The text was updated successfully, but these errors were encountered: