Giter VIP home page Giter VIP logo

cesium-webpack-example's People

Contributors

analyticalgraphics avatar ggetz avatar jjspace avatar mramato avatar sanjeetsuhag avatar sdhani avatar srothst1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cesium-webpack-example's Issues

Cesium definitely doesn't work with ES6 !!!

Hi,

Although it is advertised here and on the Cesium homepage that Cesium now supports ES6, this is not entirely true. ES6 was not implemented directly in order to only use "import" and "export" functions.

Have you ever tried to use "await" and "async"?
You will immediately notice that "await" is marked as an error, because the whole thing runs as "COMMONJS" and it is not supported by it.

I noticed that in which I wanted to use Promise in my Typescript and therefore cannot use "await" at all. As a result, asynchronous use is denied to me. I was told that in my tsconfig.json file I would have to change the module to, for example, "esNext" and the "target" to at least 2017. As soon as I do that, all of the Cesium code stops working. The script from me doesn't know either "Viewer" or "ION" as an example.

Since the "Promise" functionality is very important, I ask for urgent help and support in converting this to ES6 or higher.

Thank you in advance for the trouble.

Many greetings

Build is broken on master

To reproduce, clone: https://github.com/tinco/cesium-webpack-example

Run

npm install
npm start

For me (on MacOSX, Node v12.12.0, NPM 6.11.3) it fails with this message:

    ERROR in ./node_modules/esm/esm.js
    Module not found: Error: Can't resolve 'module' in '/Users/tinco/Source/aeroscan/cesium-webpack-example/node_modules/esm'
     @ ./node_modules/esm/esm.js 1:358-375
     @ ./node_modules/cesium/index.js
     @ ./src/index.js

it didn't work when i follow the example

hello, when my webpack.config.js is same as yours, and start the app, CLI tells me:

WARNING in ./node_modules/cesium/Source/Core/TaskProcessor.js
 140:27-34 Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
  @ ./node_modules/cesium/Source/Core/TaskProcessor.js
  @ ./node_modules/cesium/Source/Core/QuantizedMeshTerrainData.js
  @ ./node_modules/cesium/Source/Cesium.js
  @ ./src/index.js
  @ multi (webpack)-dev-server/client?http://localhost:8080 ./src/index.js

 WARNING in ./node_modules/cesium/Source/Core/buildModuleUrl.js
 57:15-22 Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
  @ ./node_modules/cesium/Source/Core/buildModuleUrl.js
  @ ./node_modules/cesium/Source/Cesium.js
  @ ./src/index.js
  @ multi (webpack)-dev-server/client?http://localhost:8080 ./src/index.js

 WARNING in ./node_modules/cesium/Source/Core/buildModuleUrl.js
 77:24-31 Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
  @ ./node_modules/cesium/Source/Core/buildModuleUrl.js
  @ ./node_modules/cesium/Source/Cesium.js
  @ ./src/index.js
  @ multi (webpack)-dev-server/client?http://localhost:8080 ./src/index.js;

the browser told me :

Error constructing CesiumWidget.
Visit http://get.webgl.org to verify that your web browser and hardware support WebGL.  Consider trying a different web browser or updating your video drivers.  Detailed error information is below:

Error: Cannot find module "."
Error: Cannot find module "."
    at webpackMissingModule (http://localhost:8080/cesium.js:30375:69)
    at buildModuleUrl (http://localhost:8080/cesium.js:30375:147)
    at new Globe (http://localhost:8080/cesium.js:192424:34)
    at new CesiumWidget (http://localhost:8080/cesium.js:218537:25)
    at new Viewer (http://localhost:8080/cesium.js:250613:28)
    at Object.<anonymous> (http://localhost:8080/cesium.js:232598:14)
    at __webpack_require__ (http://localhost:8080/cesium.js:55:30)
    at Object.<anonymous> (http://localhost:8080/cesium.js:252799:18)
    at __webpack_require__ (http://localhost:8080/cesium.js:55:30)
    at webpackJsonpCallback (http://localhost:8080/cesium.js:26:23)

I promise that my browser is updated.

createWorldTerrain not found in cesium

I cloned the cesium-webpack-example and try to run it on localhost. errors show that no createWorldTerrain in "cesium".
and then, I checked the API doc, and found it should be createWorldTerrainAsync.
I think the cesium-webpack-example uses the old version of cesium and it should be updated.

createWorldTerrain -> createWorldTerrainAsync
createOsmBuildings -> createOsmBuildingsAsync

webpack 5 example

Hi,

It would be useful with an example that works with webpack v5.

Regards

Base url issue

From CesiumGS/cesium#6319 (comment)

The documentation for Cesium and Webpack appears to be broken around 1.47, 1.48 . Whenever the iframe implementation was enforced as the dom container for the map.


Heads up, I figured it out.

CESIUM_BASE_URL : JSON.stringify('')
now needs to be
CESIUM_BASE_URL : JSON.stringify('../')

how to use the build version of cesium

when I use files in 'cesium/build/Cesuim' or 'cesium/build/CesuimUnminified' to work with webpack, it reports errors like module not find. But it worked with files in 'cesium/Source', so I just want to know why and how to correctly import cesium files in production mode.
cesium_errors

Add example to integrate ESLint import plugin

ESLint import plugin is very commonly used in medium/big size projects. Aliases should be configured so that cesium/* maps to node_modules/cesium/Source/* (as it's done for the Webpack config) and the import plugin ceases to return errors.
Are contributions accepted?

Update the webpack tutorial with latest changes

I ran into some issues attempting to follow the webpack example setup but got around it after tinkering with it a little:

  • a few packages kept failing to compile, so I had to setup a fallback in my webpack.config.js including: stream-http, https-browserify, browserify-zlib, buffer/, url/, assert/, util/, and stream-browserify
  • in the final index.js code, the modules createWorldTerrain() and createOsmBuildings() are deprecated, please update that to reflect the changes made with the latest version of 1.112.0; createWorldTerrainAsync() and createOsmBuildingsAsync() are the newly replaced modules

splitchunks in webpack 4

From CesiumGS/cesium#6610

In the cesium and webpack tutorial (https://cesiumjs.org/tutorials/cesium-and-webpack/), there is a section about code splitting which uses webpack.optimize.CommonsChunkPlugin.
However, in the new webpack 4 this has been deprecated, so you get this error:
ERROR Error: webpack.optimize.CommonsChunkPlugin has been removed, please use config.optimization.splitChunks instead.

I can't seem to work out the correct syntax for using splitChunks with cesium, it would be very helpful to add this to the tutorial.

Update for webpack4, latest cesium, and optionally vue.js?

Hi, this is a great resource along with the doc page https://cesiumjs.org/tutorials/cesium-and-webpack/ (which could be referenced from this repo readme, to be helpful), but it's out of date now.
I've spent the past day chasing my tail trying to get the latest cesium (1.49) to work with webpack 4, and vue.js. The docs and repo here are out of date and don't work, and while there are lots of helpful issues and posts around that hint at how to fix various issues, I've yet to hit on the magic combination that works.
This shouldn't be this difficult!
(but thanks for your great efforts so far)

Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

Hi I'm getting these errors when trying to run a fresh install.

Cesium loads for a second or two, then these errors pop up in the console, and Cesium exits.

    140:80-87 Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
     @ ./node_modules/cesium/Source/Core/TaskProcessor.js
     @ ./node_modules/cesium/Source/Core/QuantizedMeshTerrainData.js
     @ ./node_modules/cesium/Source/Core/CesiumTerrainProvider.js
     @ ./node_modules/cesium/Source/Cesium.js
     @ ./src/index.js
     @ multi (webpack)-dev-server/client?http://localhost:8080 ./src/index.js
    
    WARNING in ./node_modules/cesium/Source/Core/buildModuleUrl.js
    57:15-22 Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
     @ ./node_modules/cesium/Source/Core/buildModuleUrl.js
     @ ./node_modules/cesium/Source/Cesium.js
     @ ./src/index.js
     @ multi (webpack)-dev-server/client?http://localhost:8080 ./src/index.js
    
    WARNING in ./node_modules/cesium/Source/Core/buildModuleUrl.js
    77:77-84 Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
     @ ./node_modules/cesium/Source/Core/buildModuleUrl.js
     @ ./node_modules/cesium/Source/Cesium.js
     @ ./src/index.js
     @ multi (webpack)-dev-server/client?http://localhost:8080 ./src/index.js

Also copy ThirdParty/Workers

@nmschulte brought up the following solution here:

CesiumGS/cesium#5816 (comment)

 new CopyWebpackPlugin([
        {from: path.join(paths.cesiumSource, 'Assets'), to: 'Assets'},
        {from: path.join(paths.cesiumSource, 'Widgets'), to: 'Widgets'},
        {from: path.join(paths.cesiumSource, 'ThirdParty'), to: 'ThirdParty'}
    ]), 
    new CopyWebpackPlugin([
        {from: path.join(paths.cesiumSource, '../Build/Cesium/ThirdParty/Workers'), to: 'ThirdParty/Workers'},
        {from: path.join(paths.cesiumSource, '../Build/Cesium/Workers'), to: 'Workers'}
    ])  

This update should be reflected in the tutorial as well.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.