ol-cesium icon indicating copy to clipboard operation
ol-cesium copied to clipboard

No default export

Open Christoph142 opened this issue 1 year ago • 6 comments

I used to use import OLCesium from 'ol-cesium'; This works fine in 2.15.0, but in 2.15.1 and 2.15.2 angular complains that there's no default export.

Am I doing something wrong? Is the import supposed to be done differently or did something break?

Christoph142 avatar Aug 28 '23 10:08 Christoph142

Hi @Christoph142 , I can reproduce your import error with plain javascript. We are planning to rework the build system and publish only standard ES6 modules. In the meantime could you stay with 2.15.0?

gberaudo avatar Aug 29 '23 15:08 gberaudo

Thanks for checking this out. I already pinned down 2.15.0 for the time being and I'm keeping an eye on this here.

Christoph142 avatar Aug 29 '23 15:08 Christoph142

See https://github.com/openlayers/ol-cesium/discussions/1096.

gberaudo avatar Aug 31 '23 06:08 gberaudo

ES6 modules, exported types and updated build system sounds great!

@Christoph142 could you please share a working usage example on Stackblitz or similar? Would love to see your package.json and how you import and use ol-cesium 2.15.x in Angular. I have had to pin olcs 2.14.0 and cesium 1.105.2 since newer versions of either yields various errors (related to layers, overlays and vector-projections) from the Angular component that toggles 2D/3D-map. Sorry for hijacking thread, I'm asking for sort of the same end result though.

ccondrup avatar Sep 07 '23 15:09 ccondrup

@ccondrup the trick is installing ol-cesium npm package. olcs doesn't work.

Christoph142 avatar Sep 07 '23 16:09 Christoph142

I bumped into the same issue and tried going with 2.15.0 to no avail :

./node_modules/cesium/Source/Cesium.js:795:0-62 - Error: export 'parseBoundingVolumeSemantics' (reexported as 'parseBoundingVolumeSemantics') was not found in '@cesium/engine' (possible exports: AlphaMode, AlphaPipelineStage, Appearance, ApproximateTerrainHeights, [...], updateVersion, usesExtension, webGLConstantToGlslType, wrapFunction, writeTextToCanvas)

I also tried setting up a stackblitz in order to reproduce the issue but it runs into another compile issue (just uncomment line 12 in main.ts for it to occur) :

Error in /turbo_modules/[email protected]/index.cjs (10:18) Module /turbo_modules/[email protected]/Build/CesiumUnminified/index.cjs not declared as a System.registerDynamic dependency of https://angular-14-demo-pjm6dp.stackblitz.io/turbo_modules/[email protected]/index.cjs

levinzz avatar Nov 09 '23 18:11 levinzz