Comments (9)
Looks like it's a use of this particular Webpack config option: https://webpack.js.org/configuration/other-options/#amd
In combination with this change to Cesium's code to look for that special value:
CesiumGS/cesium@9aa2dff#diff-1f2d871223708f3eeff38a7821941b90
from cesium-weather.
Thanks a lot for the tutorial!
After I put
amd: {
// Enable webpack-friendly use of require in Cesium
toUrlUndefined: true
},
in my webpack.config.js
, it works.
from cesium-weather.
Resolved:
https://cesiumjs.org/forum/#!msg/cesium-dev/d69RrgOVu9c/RfCoBqrTBAAJ
http://blog.isquaredsoftware.com/2017/03/declarative-earth-part-1-cesium-webpack/
from cesium-weather.
Well, I followed the instruction but still got an error. My code structure is slightly different from the instruction. What could be the reason?
bundle.js:168429 Error constructing CesiumWidget.
Visit <a href="http://get.webgl.org">http://get.webgl.org</a> 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 (bundle.js:29861)
at buildModuleUrl (bundle.js:29861)
at new Globe (bundle.js:168694)
at new CesiumWidget (bundle.js:168075)
at new Viewer (bundle.js:103299)
at App.componentDidMount (bundle.js:102847)
at commitLifeCycles (bundle.js:96015)
at commitAllLifeCycles (bundle.js:97191)
at HTMLUnknownElement.callCallback (bundle.js:87787)
at Object.invokeGuardedCallbackDev (bundle.js:87826)
My $PROJECT/index.js
:
import React from 'react';
import ReactDOM from 'react-dom';
import App from './src/App';
import './node_modules/bootstrap/dist/css/bootstrap.min.css';
import "cesium/Source/Widgets/widgets.css";
import buildModuleUrl from "cesium/Source/Core/buildModuleUrl";
buildModuleUrl.setBaseUrl('./cesium/');
console.log(buildModuleUrl)
ReactDOM.render(<App />, document.getElementById('container'));
My $PROJECT/src/app.js
:
import React, { Component } from 'react';
import Viewer from "cesium/Source/Widgets/Viewer/Viewer";
class App extends Component {
componentDidMount() {
var viewer = new Viewer(this.cesiumContainer);
}
render() {
return (
<div className="App">
<div className="col-sm-9">
<div id="cesiumContainer" ref={ element => this.cesiumContainer = element }/>
</div>
<div className="col-sm-3">
Hello
</div>
</div>
);
}
}
export default App;
from cesium-weather.
Perhaps try removing the .
from the module URL call? Like: buildModuleUrl.setBaseUrl('cesium/');
from cesium-weather.
I just tried that. But it doesn't work and gives the same error.
from cesium-weather.
Hmm. My next suggestion would be to try following the new Webpack setup instructions in the Cesium docs: https://cesiumjs.org/tutorials/cesium-and-webpack/
from cesium-weather.
But how does this work? I search around the Webpack documentation but can't find any information. Did Cesium team contribute this special thing to Webpack?
from cesium-weather.
Thanks a lot!!
from cesium-weather.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cesium-weather.