Unable to use the latest v3.0
hkot1991 opened this issue · comments
Tried to install your latest v3.0, however I'm getting some errors on build
The first error is this:
../node_modules/@cognite/reveal/packages/model-base/index.d.ts:7:10 - error TS2305: Module '"./src/NodeIdAndTreeIndexMaps"' has no exported member 'NodeIdAndTreeIndexMaps'.
export { NodeIdAndTreeIndexMaps } from './src/NodeIdAndTreeIndexMaps';
It seems to happen because 'NodeIdAndTreeIndexMaps' is marked as internal in the code but it still exported via the model-base/index.ts file, and on bundle its not included possably because of the '"stripInternal": true,' in the tsconfig file
The second (and last) error I'm getting is this:
../node_modules/@cognite/reveal/packages/pointclouds/src/PotreeNodeWrapper.d.ts:4:25 - error TS7016: Could not find a declaration file for module '@cognite/potree-core'. './node_modules/@cognite/potree-core/dist/bundle.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/cognite__potree-core` if it exists or add a new declaration (.d.ts) file containing `declare module '@cognite/potree-core';`
import * as Potree from '@cognite/potree-core';
If I add a '.d.ts' file to my project to try and resolve the issue then I get these error:
../node_modules/@cognite/reveal/packages/pointclouds/src/PotreeNodeWrapper.d.ts:19:30 - error TS2694: Namespace '"@cognite/potree-core"' has no exported member 'PointCloudOctreeNode'.
19 readonly octtree: Potree.PointCloudOctreeNode;
~~~~~~~~~~~~~~~~~~~~
../node_modules/@cognite/reveal/packages/pointclouds/src/PotreeNodeWrapper.d.ts:22:33 - error TS2694: Namespace '"@cognite/potree-core"' has no exported member 'PointCloudOctreeNode'.
22 constructor(octtree: Potree.PointCloudOctreeNode);
Also if I update the sdk from 5.0.0 to 7.0.0 I get this error:
../node_modules/@cognite/sdk/dist/src/api/geospatial/types.d.ts:2:35 - error TS2307: Cannot find module 'geojson' or its corresponding type declarations.
2 import { Geometry, GeoJSON } from 'geojson';
Might be something wrong with the dependencies or something?
Thank you for letting us know (and the very detailed explanation). We are looking into it.
As for the last issue, are you still getting the 'geojson' error if you bump the SDK all the way to 7.2.0?
As for the last issue, are you still getting the 'geojson' error if you bump the SDK all the way to 7.2.0?
Still get the geojson error in v7.2.0
v7.2.2 has been released and should at least fix the geojson error.
We are struggling to reproduce the other errors (even when starting a fresh project). Would it be possible for you to provide a minimal example?
The geojson error got removed when I upgraded now (but only if I added @types/geojson as dependency), the others remains and seems to be related to typings
It looks to me like you guys are skipping typescheck on build (examples/tsconfig.json "skipLibCheck": true, )
If you flipp this to false then you will be able to reproduce the Namespace '"@cognite/potree-core"' has no exported member 'PointCloudOctreeNode'
Seems to be related to the fact that "@cognite/potree-core" has no typings
And the error:
../node_modules/@cognite/reveal/packages/model-base/index.d.ts:7:10 - error TS2305: Module '"./src/NodeIdAndTreeIndexMaps"' has no exported member 'NodeIdAndTreeIndexMaps'.
export { NodeIdAndTreeIndexMaps } from './src/NodeIdAndTreeIndexMaps';
might also be related to typings, as you can backtrack the error to the d.ts files where NodeIdAndTreeIndexMaps in fact do not export NodeIdAndTreeIndexMaps:
Yup, you are totally right. Working on a patch now. It is intentional that NodeIdAndTreeIndexMap
is not exposed (since it is not used in the public API), but we mistakenly reference it in the model-base index.d.ts, which then ends up exposing it though it has been stripped.
The other error is also caused in a similar fashion. Will try to release a patch today.
Hey,
An attempt has been made and a new release has been published 3.0.1. Please reopen if there are still errors persisting.
Btw, I added types for geojson as a direct dependency in reveal (until it is properly added to the SDK), so you can remove it on your end. Thanks for the help.