Select to view content in your preferred language

React compilation error with Basemap.js

345
3
07-07-2024 11:13 PM
bunyip65
New Contributor

I'm trying to compile a React project and am getting the following error - could anyone kindly help?:

./node_modules/@arcgis/core/Basemap.js 106:28
Module parse failed: Unexpected token (106:28)
File was processed with these loaders:
* ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| }
| write(e, r) {
> return e = e || {}, r?.origin || (r = {
| origin: "web-map",
| ...r

With thanks

Tags (3)
0 Kudos
3 Replies
AndyGup
Esri Regular Contributor

Hi @bunyip65 this issue is most likely not related to the ArcGIS JavaScript SDK.These errors are typically related to transpiling. You may be missing a transpiler plugin or need to upgrade to a newer version of the module bundler. For reference, see our Troubleshooting documentation under Configuration issues: https://developers.arcgis.com/javascript/latest/troubleshooting/#configuration-issues

0 Kudos
bunyip65
New Contributor

Hi Andy,

Many thanks for your prompt reply.   I'll  give it a go and see what happens!

 

0 Kudos
JeffreyThompson2
MVP Regular Contributor

Typically when I see this error, it's a syntax problem. Make sure all your brackets and functions are closed properly.

GIS Developer
City of Arlington, Texas
0 Kudos