Comments (10)
I haven't seen that error before. What's the pathname for buffer.js
? Is that a JS API module?
I'll run some tests on my end.
from angular-cli-esri-map.
@nbabel I didn't see the same issues you reported but I also wasn't able to run the webpack sample using 4.17. I'll need to investigate further. Here's a screenshot of the errors I'm seeing:
from angular-cli-esri-map.
Okay, the problem I'm seeing is when you upgrade the webpack plugin you also need to set the DEFAULT_WORKER_URL
to the same base version of the plugin. So once I did the following then the app worked for me:
const DEFAULT_WORKER_URL = "https://js.arcgis.com/4.17/";
from angular-cli-esri-map.
Thanks @andygup, I have set the DEFAULT_WORKER_URL to the same as the base version of the plugin, but it's still not working.
Here is the full warning I get in a shell window when I run npm install:
warning: templates not found in C:\Users\NBabel\AppData\Local\Temp\pacote-git-template-tmp\git-clone-0c79d1e2
Here is the full error I'm getting from ng serve:
95% emitting index-html-webpack-pluginbuffer.js:313
throw new ERR_INVALID_ARG_TYPE(
^
TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined
at Function.from (buffer.js:313:9)
at writeOut (C:\Projects\WFDSS\NextGen\repo\code\UI_NextGen\node_modules\webpack\lib\Compiler.js:413:27)
at Immediate._onImmediate (C:\Projects\WFDSS\NextGen\repo\code\UI_NextGen\node_modules\memory-fs\lib\MemoryFileSystem.js:288:4)
at processImmediate (internal/timers.js:456:21) {
code: 'ERR_INVALID_ARG_TYPE'
}
The only thing I'm changing in my package.json file is
"dependencies": { "@types/arcgis-js-api": "4.17.0", }
"devDependencies": { "@arcgis/webpack-plugin": "4.17", }
I'm using node v12.16.0 if that makes any difference.
from angular-cli-esri-map.
@nbabel thanks. You might try this in your webpack config:
node: {
process: false,
global: false,
Buffer: false,
setImmediate: false,
fs: 'empty',
},
from angular-cli-esri-map.
Unfortunately, that had no effect. This is my webpack.config file without those changes:
const ArcGISPlugin = require("@arcgis/webpack-plugin");
const LiveReloadPlugin = require('webpack-livereload-plugin');
const options = {
protocol: 'http',
port: 35730,
hostname: 'localhost',
// appendScriptTag: true,
delay: 0,
};
module.exports = {
plugins: [
new ArcGISPlugin(),
new LiveReloadPlugin(options)
],
node: {
process: false,
global: false,
fs: "empty"
}
};
from angular-cli-esri-map.
Gotcha. I have a some questions:
- Make sure you are running the latest version of the webpack-plugin:
npm install @arcgis/webpack-plugin@latest
. Your version should4.17.5
- Can you paste your
package.json
file here? - What is
index-html-webpack-pluginbuffer.js
? It's in the error message you posted. It's sounds like a webpack file but I did a quick search for it and didn't find anything obvious. - And
buffer.js
Is that the buffer module from node.js or one of yours? Just double checking.
at Function.from (buffer.js:313:9)
- Can you create a stackblitz app that reproduces this issue?
from angular-cli-esri-map.
Closing as inactive. Feel free to provide follow-up info, if needed.
from angular-cli-esri-map.
Just getting back to this. It appears using version 4.17.5 has done the trick. I'm not getting the errors I was before and the map and layers are loading correctly. However, there is a warning in the console: Failed to create Worker. Fallback to execute module in main thread.
It has a message of: Uncaught NetworkError: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'https://js.arcgis.com/4.17.5/dojo/dojo-lite.js' failed to load. Is dojo-lite.js not included with 4.17.5 anymore?
Everything appears to be working, so I guess it isn't needed?
from angular-cli-esri-map.
Good deal. That message is a performance degradation warning because the workers aren't configured correctly.
You might try out @arcgis/core which will go into beta in the week or two: https://www.npmjs.com/package/@arcgis/core. That build uses native ES modules (rather than AMD), won't need to configure webpack and the workers code is embedded.
More info here: https://github.com/Esri/feedback-js-api-next/tree/master/esm-samples/jsapi-angular-cli
from angular-cli-esri-map.
Related Issues (20)
- `Unhandled Promise rejection` errors are thrown on SceneView panning and zooming HOT 1
- `Unhandled Promise rejection` errors are thrown when adding basemaps to existing BasemapGalleryWidget HOT 4
- Repo retirement notice for 4.22 HOT 1
- esri-view not working when used height=100% HOT 5
- esriSignInDialog broken in JS API 4.15 using the Angular CLI and esri-loader HOT 3
- Popup template format not working HOT 2
- Document handling change detection in Angular components HOT 1
- "Cannot read property 'processors' of undefined" when using FeatureLayer, Angular 10 HOT 4
- Destroying the map - memory leak HOT 2
- Creating a Search Widget in Angular with No Map HOT 4
- click event hitTest() result undefined HOT 9
- Document using local css and workers
- Error on executing npm install command for ESRI webPack HOT 2
- ENOENT: no such file or directory HOT 3
- Deprecation notice - update repo for ArcGIS JS API ES modules (beta) at 4.18 HOT 8
- Upgrade to 4.12 fails in IE11 HOT 7
- Where is urlUtils imported from? HOT 4
- Uncaught ReferenceError: __esri is not defined HOT 5
- NgRx effects with QueryTask HOT 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 angular-cli-esri-map.