rdf-js is used, but not listed in package.json
mrkvon opened this issue · comments
Environment
- Server version: 7.0.3
- Node.js version: 20.8.1
- npm version: 10.2.1
Description
It looks like rdf-js
is imported e.g. in src/util/Vocabularies.ts, but it (nor @types/rdf-js) is not listed in package.json dependencies.
This doesn't cause problems, because rdf-js
is sub-dependency of other packages, but it is a fragile situation.
Fix
I can see that (equivalent?) @rdfjs/types
is installed, so instead of import type { NamedNode } from 'rdf-js';
it could be import type { NamedNode } from '@rdfjs/types'
.
It may cause issue sometimes
I work on a project with yarn where @solid/community-server is a dependency. When i remove node_modules
and yarn.lock
, then reinstall node modules with yarn
, some sub-dependencies aren't installed and this results in tsc errors:
node_modules/@solid/access-token-verifier/dist/class/DPoPJTICache.d.ts(3,43): error TS2507: Type 'typeof import("/home/michal/dev/ohn/sleepy.bike/simple-email-notifications/node_modules/lru-cache/dist/commonjs/index")' is not a constructor function type.
node_modules/@solid/access-token-verifier/dist/class/IssuerKeySetCache.d.ts(4,48): error TS2507: Type 'typeof import("/home/michal/dev/ohn/sleepy.bike/simple-email-notifications/node_modules/lru-cache/dist/commonjs/index")' is not a constructor function type.
node_modules/@solid/access-token-verifier/dist/class/WebIDIssuersCache.d.ts(3,48): error TS2507: Type 'typeof import("/home/michal/dev/ohn/sleepy.bike/simple-email-notifications/node_modules/lru-cache/dist/commonjs/index")' is not a constructor function type.
node_modules/@solid/community-server/dist/authorization/AcpUtil.d.ts(3,27): error TS2307: Cannot find module 'rdf-js' or its corresponding type declarations.
node_modules/@solid/community-server/dist/http/representation/N3Patch.d.ts(1,27): error TS2307: Cannot find module 'rdf-js' or its corresponding type declarations.
node_modules/@solid/community-server/dist/http/representation/RepresentationMetadata.d.ts(1,78): error TS2307: Cannot find module 'rdf-js' or its corresponding type declarations.
node_modules/@solid/community-server/dist/server/notifications/BaseChannelType.d.ts(2,38): error TS2307: Cannot find module 'rdf-js' or its corresponding type declarations.
node_modules/@solid/community-server/dist/storage/DataAccessorBasedStore.d.ts(1,27): error TS2307: Cannot find module 'rdf-js' or its corresponding type declarations.
node_modules/@solid/community-server/dist/util/QuadUtil.d.ts(5,33): error TS2307: Cannot find module 'rdf-js' or its corresponding type declarations.
node_modules/@solid/community-server/dist/util/TermUtil.d.ts(1,47): error TS2307: Cannot find module 'rdf-js' or its corresponding type declarations.
node_modules/@solid/community-server/dist/util/Vocabularies.d.ts(1,32): error TS2307: Cannot find module 'rdf-js' or its corresponding type declarations.
node_modules/@solid/community-server/dist/util/errors/HttpError.d.ts(1,32): error TS2307: Cannot find module 'rdf-js' or its corresponding type declarations.
node_modules/rdf-parse/lib/index.d.ts(3,42): error TS2307: Cannot find module 'rdf-js' or its corresponding type declarations.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Good catch