gitea icon indicating copy to clipboard operation
gitea copied to clipboard

error 500 when clicking npm package

Open init-rz opened this issue 2 years ago • 1 comments

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

image

Git Version

No response

Operating System

2.37.0.windows.1

How are you running Gitea?

downloaded window exe from gitea.io

Database

PostgreSQL

init-rz avatar Aug 02 '22 10:08 init-rz

.PackageDescriptor maybe nil

lunny avatar Aug 02 '22 10:08 lunny

How did you upload npm package and which url you are viewing the package

lunny avatar Aug 07 '22 15:08 lunny

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 }

init-rz avatar Aug 08 '22 09:08 init-rz

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

Topograph avatar Aug 09 '22 14:08 Topograph

I was having the same trouble; the revised npm template file in PR #20675 fixes this.

RoystonS avatar Aug 13 '22 19:08 RoystonS