Skip to content

log-viewer-webui: @types/node is missing from devDependencies. #1006

@junhaoliao

Description

@junhaoliao

Bug

As the title suggests. The dev dep is missing from package.json specification, although package-lock.json does track the dependency:

"node_modules/@types/node": {
"version": "22.15.20",
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.20.tgz",
"integrity": "sha512-A6BohGFRGHAscJsTslDCA9JG7qSJr/DWUvrvY8yi9IgnGtMxCyat7vvQ//MFa0DnLsyuS3wYTpLdw4Hf+Q5JXw==",
"dev": true,
"license": "MIT",
"optional": true,
"peer": true,
"dependencies": {
"undici-types": "~6.21.0"
}

We will face build failure after we run npm prune. See the "Reproduction steps" section for another potential issue.

CLP version

a37f68c

Environment

junhao@GIGABYTE:~/workspace/clp/components/log-viewer-webui/client$ npm --version
10.9.2
junhao@GIGABYTE:~/workspace/clp/components/log-viewer-webui/client$ node --version
v22.14.0

Reproduction steps

cd clp
cd components/log-viewer-webui/client

rm -rf ./node_modules
rm package-lock.json

npm i
npm run build

->

> log-viewer-webui-client@0.1.0 build
> tsc -b && vite build

vite.config.ts:1:18 - error TS2307: Cannot find module 'node:path' or its corresponding type declarations.

1 import path from "node:path";
                   ~~~~~~~~~~~

vite.config.ts:19:37 - error TS2304: Cannot find name '__dirname'.

19             "@common": path.resolve(__dirname, "../common"),
                                       ~~~~~~~~~


Found 2 errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions