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.

CRA(create-react-app) add arcgis-webpack-plugin, compile failed

See original GitHub issue

this is the demo: https://github.com/nightsu/arcgis-react.git

Description

  1. CRA: npm create-react-app arcgis-react, and npm install,
  2. npm install @arcgis-webpack-plugin,
  3. npm run eject,
  4. add new ArcGISPlugin() to config/webpack.config.js const ArcGISPlugin = require("@arcgis/webpack-plugin"); ... module.exports = { ... plugins: [ ... new ArcGISPlugin(), ... ] ... }
  5. npm start

Expected Behavior

compile succeeded.

Actual Behavior

compile failed. error: if (!request.context.issuer) { ^ TypeError: Cannot read property 'issuer' of undefined at resolver.hooks.file.tapAsync (..\arcgis-react\node_modules\react-dev-utils\ModuleScopePlugin.js:26:30)

Possible Fix

Steps to Reproduce

1.download or clone https://github.com/nightsu/arcgis-react.git 2.npm install 3.npm start

Context

Your Environment

  • Version used:
  • Browser Name and version:
  • Operating System and version (desktop or mobile):
  • Link to your project if available: package.json “@arcgis/webpack-plugin”: “^4.13.1”, “@babel/core”: “7.7.4”, “@svgr/webpack”: “4.3.3”, “@testing-library/jest-dom”: “^4.2.4”, “@testing-library/react”: “^9.3.2”, “@testing-library/user-event”: “^7.1.2”, “@typescript-eslint/eslint-plugin”: “^2.8.0”, “@typescript-eslint/parser”: “^2.8.0”, “arcgispack”: “0.0.27”, “babel-eslint”: “10.0.3”, “babel-jest”: “^24.9.0”, “babel-loader”: “8.0.6”, “babel-plugin-named-asset-import”: “^0.3.5”, “babel-preset-react-app”: “^9.1.0”, “camelcase”: “^5.3.1”, “case-sensitive-paths-webpack-plugin”: “2.2.0”, “css-loader”: “3.2.0”, “dotenv”: “8.2.0”, “dotenv-expand”: “5.1.0”, “eslint”: “^6.6.0”, “eslint-config-react-app”: “^5.1.0”, “eslint-loader”: “3.0.2”, “eslint-plugin-flowtype”: “3.13.0”, “eslint-plugin-import”: “2.18.2”, “eslint-plugin-jsx-a11y”: “6.2.3”, “eslint-plugin-react”: “7.16.0”, “eslint-plugin-react-hooks”: “^1.6.1”, “file-loader”: “4.3.0”, “fs-extra”: “^8.1.0”, “html-webpack-plugin”: “4.0.0-beta.5”, “identity-obj-proxy”: “3.0.0”, “jest”: “24.9.0”, “jest-environment-jsdom-fourteen”: “0.1.0”, “jest-resolve”: “24.9.0”, “jest-watch-typeahead”: “0.4.2”, “mini-css-extract-plugin”: “0.8.0”, “optimize-css-assets-webpack-plugin”: “5.0.3”, “pnp-webpack-plugin”: “1.5.0”, “postcss-flexbugs-fixes”: “4.1.0”, “postcss-loader”: “3.0.0”, “postcss-normalize”: “8.0.1”, “postcss-preset-env”: “6.7.0”, “postcss-safe-parser”: “4.0.1”, “react”: “^16.12.0”, “react-app-polyfill”: “^1.0.5”, “react-dev-utils”: “^10.0.0”, “react-dom”: “^16.12.0”, “resolve”: “^1.12.2”, “resolve-url-loader”: “3.1.1”, “sass-loader”: “8.0.0”, “semver”: “6.3.0”, “style-loader”: “1.0.0”, “terser-webpack-plugin”: “2.2.1”, “ts-pnp”: “1.1.5”, “url-loader”: “2.3.0”, “webpack”: “4.41.2”, “webpack-cli”: “^3.3.10”, “webpack-dev-server”: “3.9.0”, “webpack-manifest-plugin”: “2.2.0”, “workbox-webpack-plugin”: “4.3.1”

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:5

github_iconTop GitHub Comments

4reactions
boualikamelcommented, Jan 19, 2020

Hello everybody, @nightsu I’ve just tried to introduce jsapi4 into a CRA template, using react-app-rewired. it worked but the esri icons didnt yet worked if you have any suggestion to improve you can contribute.

this is the demo https://github.com/boualikamel/cra-arcgis

edited __

i’ve juste fixed the icon problem, i hope that will help you dude

3reactions
shehabelharirycommented, Jan 5, 2020

I have the same issue. Any fixes?

Read more comments on GitHub >

github_iconTop Results From Across the Web

My create-react-app is failing to compile due to ESLint error
We are going to add another script to our package.json file. "postinstall":"patch-package" . This above script will run every time when we ...
Read more >
Webpack exclude node_modules - cosefin.it
In order to exclude node_modules and native node libraries from bundling, you need to: Add target: 'node' to your webpack. Finally, redefine the...
Read more >
Deployment | Create React App
npm run build creates a build directory with a production build of ... Router with browserHistory ), many static file servers will fail....
Read more >
Vite 3.0 vs. Create React App: Comparison and migration guide
This makes CRA unfit for production. In this guide, we'll introduce Vite, a build tool built on esbuild. We'll cover everything you need...
Read more >
Using React with TypeScript - Mattermost
Learn how to create a new TypeScript app with create-react-app and convert an ... Before adding support for TypeScript in CRA v2.1.0, ...
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