Closed gavinr closed 2 years ago
Thanks for letting us know @gavinr, we'll take a look.
@gavinr thanks to some sleuthing by @odoe, the issue seems to be the browserslist
.
Can give this a try?
"browserslist": {
"production": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
And just an FYI, here's an example of the full .browserslistrc
we use for the samples: https://github.com/Esri/jsapi-resources/blob/master/esm-samples/jsapi-angular-cli/.browserslistrc
Ah, yes it definitely looks like that's it. And that is here, sorry I missed it. (but it is easy to miss buried in the package.json) Thanks!!
(Just out of curiosity, do you know why the default CRA settings for browserslist.production
causes the JS API error?)
@gavinr yep, the browserslist can affect/trigger transpiling, so it may result in a build containing features that aren't supported in your browser.
It can also affect bundle sizes. Typically targeting newer browsers results in smaller bundle sizes.
@arcgis/core version:
@arcgis/core@4.23.3
Framework and build tools Latest Create React App:
Describe the bug I am trying to use the create react sample from this repo, but with the create react app typescript template.
Expected behavior After starting with the Create React App typescript template and using the code from the create react sample from this repo, when running
npm run build
it should create a build that works (map showing in the web browser) in the same way that it works when I runnpm start
.Reproduce the issue
In the terminal:
npm start
- notice that the app works fine (map shows, no errors in browser console)Run:
npm start
(map loads correctly)Browser
Operating System: