question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Trying to get started - error cannot resolve env in geometry\support

See original GitHub issue

Description

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:closed
  • Created 5 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
roemhildtgcommented, May 18, 2018

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!

0reactions
46319943commented, Sep 10, 2020

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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found