When using the current release of the arcgis-js-api (4.20.2) and using the local assets (esriConfig.assetsPath = "./assets"😉 the assets do not seem to be up to date, i receive the following message on load:
30cfa4b0-c6b0-4fa5-a5e1-ac799d7f3ee0:1 [esri.core.workers] Version mismatch detected between ArcGIS API for JavaScript and assets:
API version: 4.20 [Date: 20210707, Revision: 17f9314e]
Assets version: 4.20 [Date: 20210701, Revision: d19b8a11]
This appears to manifest in a missing file:
message: "Uncaught NetworkError: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'assets/esri/core/workers/chunks/4ec871ce4f503ff84927.js' failed to load."
Solved! Go to Solution.
Thanks Andy,
I don't usually need to do this but we have a client in a sandboxed environment.
I have resolved the issue by using a grunt task to touch the asset files
grunt.loadNpmTasks('grunt-touch');
grunt.initConfig({
touch: {
options: {
match: true,
mtime: true
},
target: ['pathto/assets/**/*'],
}
});
grunt.registerTask(['touch']);
How are you copying your assets? Maybe delete the assets in your working directory and recopy just to make sure you have the most current ones.
I'm still not sure what my issue is but this seems to happen when I launch the debugger from vscode, perhaps it is caching the assets from the previous release.
I feel this issue might be related to the RemoteClient.js, when I look at this file in windows it has an incorrect date
Update: https://github.com/npm/npm/issues/20439 looks like this is caused by an npm "feature", any copy that uses the last modified date is having issues (dojo copy?, aws s3 sync?)
Do you need to use local assets? It's not required, try commenting out esriConfig and see if your app works:
// esriConfig.assetsPath = "./assets"; // comment out this line
Additional reading: https://developers.arcgis.com/javascript/latest/es-modules/#working-with-assets
Thanks Andy,
I don't usually need to do this but we have a client in a sandboxed environment.
I have resolved the issue by using a grunt task to touch the asset files
grunt.loadNpmTasks('grunt-touch');
grunt.initConfig({
touch: {
options: {
match: true,
mtime: true
},
target: ['pathto/assets/**/*'],
}
});
grunt.registerTask(['touch']);