gitea
gitea copied to clipboard
error 500 when clicking npm package
Description
publish an npm package in the ui click on the package. a 500 error is returned. log output: 2022/08/02 12:02:12 ...s/context/context.go:219:HTML() [D] [62e8f624] Template: package/view 2022/08/02 12:02:12 ...s/context/context.go:232:HTML() [E] [62e8f624] Render failed: template: package/metadata/npm:5:27: executing "package/metadata/npm" at <.PackageDescriptor.Properties>: can't evaluate field Properties in type interface {} 2022/08/02 12:02:12 ...s/context/context.go:219:HTML() [D] [62e8f624] Template: status/500
Gitea Version
1.17.0
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Screenshots
Git Version
No response
Operating System
2.37.0.windows.1
How are you running Gitea?
downloaded window exe from gitea.io
Database
PostgreSQL
.PackageDescriptor
maybe nil
How did you upload npm package and which url you are viewing the package
npm package was uploaded as described in the gitea docs:
npm config set @initka.bogis1:registry http://server:3003/api/packages/ui_frameworks_js/npm/ npm config set -- '//server:3003/api/packages/ui_frameworks_js/npm/:_authToken' "xxx"
npm publish
URL we are viewing is:
http://server:3003/ui_frameworks_js/-/packages/npm/@initka.bogis1%2Fvue-init-jsuggest/1.1.2
here package.json:
{ "name": "@initka.bogis1/vue-init-jsuggest", "version": "1.1.2", "files": [ "dist" ], "module": "./dist/vue-init-jsuggest.es.js", "types": "./dist/index.d.ts", "scripts": { "build": "vue-tsc && vite build", "watch": "vue-tsc && vite build --watch --mode development" } xxx }
I'm having the same error. Uploaded the package like @init-rz did and visiting the packages page shows error 500 with the same message.
Message: template: package/metadata/npm:5:27: executing "package/metadata/npm" at <.PackageDescriptor.Properties>: can't evaluate field Properties in type interface {}
Installation: Running gitea 1.17.0 via docker on a ubuntu server
I was having the same trouble; the revised npm template file in PR #20675 fixes this.