Closed defrex closed 1 year ago
Are all the packages up to date? Usually this only happens if you somehow have a mixed set of packages with different versions.
Might be helpful to see the output of npm ls -a
if there's doubt.
Yup, I've updated them all to @latest
package.json
"@badgateway/oauth2-client": "^2.0.16",
"@curveball/bodyparser": "^0.5.0",
"@curveball/browser": "^0.19.3",
"@curveball/browser-to-bearer": "^0.3.5",
"@curveball/controller": "^0.4.0",
"@curveball/core": "^0.20.0",
"@curveball/cors": "^0.2.0",
"@curveball/http-errors": "^0.4.1",
"@curveball/links": "^0.2.0",
"@curveball/oauth2": "^0.4.2",
"@curveball/problem": "^0.4.0",
"@curveball/router": "^0.4.2",
"@curveball/session": "^0.8.0",
"@curveball/session-redis": "^0.5.0",
"@curveball/validator": "^0.10.0",
╚╡npm ls -w apps/api -a | grep curveball
├─┬ @curveball/bodyparser@0.5.0
│ └─┬ @curveball/kernel@0.20.0
│ ├── @curveball/http-errors@0.4.1 deduped
├─┬ @curveball/browser-to-bearer@0.3.5
│ ├── @curveball/core@0.20.0 deduped
│ └── @curveball/session@0.8.0 deduped
├─┬ @curveball/browser@0.19.3
│ ├── @curveball/kernel@0.20.0 deduped
│ ├─┬ @curveball/static@0.3.0
│ │ ├── @curveball/kernel@0.20.0 deduped
├─┬ @curveball/controller@0.4.0
│ ├── @curveball/http-errors@0.4.1 deduped
│ └── @curveball/kernel@0.20.0 deduped
├─┬ @curveball/core@0.20.0
│ ├── @curveball/http-errors@0.4.1 deduped
│ ├── @curveball/kernel@0.20.0 deduped
├─┬ @curveball/cors@0.2.0
│ ├── @curveball/http-errors@0.4.1 deduped
│ └── @curveball/kernel@0.20.0 deduped
├── @curveball/http-errors@0.4.1
├─┬ @curveball/links@0.2.0
│ ├── @curveball/kernel@0.20.0 deduped
├─┬ @curveball/oauth2@0.4.2
│ ├── @curveball/http-errors@0.4.1 deduped
│ ├── @curveball/kernel@0.20.0 deduped
├─┬ @curveball/problem@0.4.0
│ └── @curveball/kernel@0.20.0 deduped
├─┬ @curveball/router@0.4.2
│ ├── @curveball/core@0.20.0 deduped
├─┬ @curveball/session-redis@0.5.0
│ ├── @curveball/kernel@0.20.0 deduped
├─┬ @curveball/session@0.8.0
│ ├── @curveball/kernel@0.20.0 deduped
├─┬ @curveball/validator@0.10.0
│ ├── @curveball/controller@0.4.0 deduped
│ ├── @curveball/http-errors@0.4.1 deduped
│ ├── @curveball/kernel@0.20.0 deduped
│ ├── @curveball/links@0.2.0 deduped
Looking at this list, i think we're at least missing a npm release for browser-to-bearer. 0.4.0 is the latest, but the publish action failed:
https://github.com/curveball/browser-to-bearer/actions/runs/2986071165
Gonna fix this
This has a new release:
https://github.com/curveball/browser-to-bearer/releases/tag/v0.4.1
@curveball/router in this list is also old. This is correctly released and I would say very likely the actual culprit.
I'm 90% sure upgrading router will fix this, so closing this ticket with that premise. If I'm wrong, we can re-open.
npm install @curveball/router@latest
results in 0.4.2
somehow. Even if I npm i @curveball/router@0.5.0
or manually set it in package.json
, the resulting entry in package-lock.json
is.
"apps/api/node_modules/@curveball/router": {
"version": "0.4.2",
"resolved": "https://registry.npmjs.org/@curveball/router/-/router-0.4.2.tgz",
"integrity": "sha512-uEz5QDDBiLl8vHuq37RoGycQ69KcWSXeyQaIEielY/uc/AApSkOUyK28BQ58MAaa1I/BoXpoe471i6PROAE8gg==",
"dependencies": {
"path-to-regexp": "^6.2.0"
},
"engines": {
"node": ">= 14"
},
"peerDependencies": {
"@curveball/core": ">=0.19 <1"
}
},
Is it possible something is wrong with that release as well? NPM does seem to think there is a valid version, it just refuses to install.
Pretty strange! You're not using some internal npm registry are you?
If you're willing to share package-lock, I could also take a look there. Also curious what is set in your own package.json
for that dependency.
In
@curveball/core@0.20.0
, I can't use the exportedContext
to define a middleware, else they will be incompatible. Since controllers are middleware, this also makes controllers type-incompatible withroute
.The above should work, but results in the following error.
The same error appears if both are imported from
@curveball/kernel
BTW, so that isn't a fix here.