Trying to get started - error cannot resolve env in geometry\support
See original GitHub issueDescription
Webpack throws error:
ERROR in ./node_modules/arcgis-js-api/geometry/support/pe-wasm.wasm
Module not found: Error: Can't resolve 'env' in 'C:\Users\groemhildt\web\webpack-demo\node_modules\arcgis-js-api\geometry\support'
@ ./node_modules/arcgis-js-api/geometry/support/pe-wasm.wasm
@ ./node_modules/arcgis-js-api/geometry/pe.js
@ ./node_modules/arcgis-js-api/geometry/projection.js
@ ./node_modules/arcgis-js-api/layers/graphics/sources/support/CSVSourceWorker.js
@ ./node_modules/arcgis-js-api/core/workers/WorkerFallback.js
@ ./node_modules/arcgis-js-api/core/workers/workerFactory.js
@ ./node_modules/arcgis-js-api/core/workers/WorkerOwner.js
@ ./node_modules/arcgis-js-api/core/workers/workers.js
@ ./node_modules/arcgis-js-api/core/workers.js
@ ./node_modules/arcgis-js-api/layers/graphics/sources/CSVSource.js
@ ./node_modules/arcgis-js-api/layers/CSVLayer.js
@ ./node_modules/arcgis-js-api/layers/support/lazyLayerLoader.js
@ ./node_modules/arcgis-js-api/portal/support/layersCreator.js
@ ./node_modules/arcgis-js-api/Basemap.js
@ ./node_modules/arcgis-js-api/Map.js
@ ./src/index.js
@ multi (webpack)-dev-server/client?http://localhost:9000 ./src/index.js C:/Users/~1/AppData/Local/Temp/tmp-6904WEC1WeU3vRII/dojo/dojo.js
Steps to Reproduce
//webpack config:
const path = require('path');
const ArcGISPlugin = require('@arcgis/webpack-plugin');
module.exports = {
entry: [
'./src/index.js'
],
plugins: [new ArcGISPlugin],
resolve: {
alias: {
'esri': 'arcgis-js-api'
}
},
output: {
path: __dirname + '/dist',
publicPath: '/',
filename: 'bundle.js'
},
devServer: {
contentBase: path.join(__dirname, 'dist'),
compress: true,
port: 9000
}
};
//entry point
import './config/loaderConfig';
import Map from 'esri/Map';
export function component() {
var element = document.createElement('div');
// Lodash, currently included via a script, is required for this line to work
element.innerHTML = ['Hello', 'webpack'].join(' ');
return element;
}
document.body.appendChild(component());
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
create react app not picking up .env files? - Stack Overflow
@MariaJeysinghAnbu, I wanted to use dotenv but got an error. I checked the documentation but didn't find that -e option for the command...
Read more >Troubleshoot issues when passing environment variables to ...
The environment variable isn't automatically refreshed. Resolution. Your Amazon ECS task execution role doesn't have the required IAM ...
Read more >react-native-dotenv - npm
Load environment variables using import statements.. Latest version: 3.4.6, last published: 25 days ago. Start using react-native-dotenv in ...
Read more >Using Environment Variables in Node.js for App Configuration ...
Many developers start with hard-coded config and secrets in either JSON or JavaScript files, and while this works, it poses a security risk ......
Read more >Using Environment Variables | Cloud Functions Documentation
If you want to selectively remove runtime environment variables you can use the ... lead to unintended consequences such as functions that cannot...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I realized I was missing the
externals
for the pe-wasm stuff. That got it to build. Could’ve been a few other issues you brought up too. Thanks @odoe ! Great work on the web pack stuff!Thank you! Adding it as externals successfully solved my problem. But why is this necessary?