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.

@arcgis/core: webpack loader errors with React and TypeScript

See original GitHub issue

@arcgis/core version @arcgis/core 4.23.7, @types/arcgis-js-api 4.23.1

Framework and build tools create-react-app 4.0.3, typescript 4.6.4

Describe the bug I am getting these webpack loader errors during dev for all the @arcgis/core widgets. My IDE and the app itself in the browser seem to run fine otherwise.

image

Expected behavior The app will still run, but upgrading to create-react-app v5 and the newer version of webpack it uses escalates these warnings to errors and the app will no longer run.

Reproduce the issue This project is a wrapper library around @arcgis/core to make it easier to use in React so there is not a simple way to reproduce the issue. I can provide other info if it would be helpful. Here is the tsconfig:

// tsconfig.json
{
  "compilerOptions": {
    "target": "es5",
    "lib": [
      "dom",
      "dom.iterable",
      "esnext"
    ],
    "allowJs": true,
    "skipLibCheck": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "noFallthroughCasesInSwitch": true,
    "module": "esnext",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "noEmit": true,
    "jsx": "react-jsx",
    "experimentalDecorators": true,
    "importHelpers": true,
    "noImplicitAny": true
  },
  "include": [
    "src"
  ]
}

Browser (check https://whatismybrowser.com/) Chrome 101 on Windows 10

Operating System (check https://whatsmyos.com):

  • OS: Windows 10 64bit
  • Device: PC

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mikepiankacommented, May 6, 2022

Things work with no webpack issues using @odoe’s repo. Must have been some issue with a combination of older dependencies is all I can think of. Thanks again.

1reaction
andygupcommented, May 4, 2022

Correct, no need for a separate install. @arcgis/core comes with the TypeScript types included.

Read more comments on GitHub >

github_iconTop Results From Across the Web

CRA(create-react-app) add arcgis-webpack-plugin, compile ...
@nightsu Thank you. The thing is I am integrating the api into an existing CRA. I used the esri-loader method and it worked...
Read more >
Setting up your TypeScript environment - ArcGIS Developers
There are many advantages to using TypeScript. Its primary function is identifying type errors before the code runs, which is often referred to...
Read more >
How to fix " Error: Can't resolve '@arcgis/core/MapView' "
Your path to MapView incorrect, you miss views directory. Try import MapView from "@arcgis/core/views/MapView"; like in official docs.
Read more >
Build Error with Typescript - Esri Community
We have a Preact app using the Preact-cli with Typescript template The tsconfig.json is configured exactly per here:
Read more >
ArcGIS API for JavaScript: Building Apps with React - YouTube
Learn to build powerful applications that integrate the ArcGIS API for JavaScript via @ arcgis/core or Esri- loader.
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