Cannot find module 'dojo/i18n!..

1028
3
11-22-2017 12:42 PM
Alexys_HerleymRodriguez_Avell1
New Contributor II

I am trying to install (IIS Local - Windows 10) the Widget code of  this DevSummit 2007:

Customizing the ArcGIS API for JavaScript Widgets

Alan Sangma – @alansangma

Matt Driscoll – @driskull

JC Franco – @arfncode

https://jcfranco.github.io/dev-summit-2017-customizing-widgets/slides/#/

https://youtu.be/UK5Hnjl9keA
http://proceedings.esri.com/library/userconf/devsummit17/papers/dev_int_81.pdf

But it is not possible to use (compile or run) the Compass Widget, because I have this error in my Visual Studio Code editor:

Cannot find module 'dojo/i18n!esri/widgets/Compass/nls/Compass'.

[ts] No se encuentra el módulo 'dojo/i18n!esri/widgets/Compass/nls/Compass'.

I followed the steps provided:

dev-summit-2017-customizing-widgets/compass.md at master · jcfranco/dev-summit-2017-customizing-widg... 

I tried to change the paths, but I think there is a problem with the Typings of dojo. I ran the previous steps to configure the Widget Folder:

I created the package.json: npm init --yes

I installed Dojo Typings: npm install dojo-typings --save-dev

I installed typings for JASAPI ArcGis: npm install --save @types/arcgis-js-api

I created the config.json

As you can see in the image, I tried to install i18n and its typing .. but nothing, the same problem!

i18n load error in the Compass Widget code

How can I fix the access to dojo/i18n module?

Cheers!

Alexys H

0 Kudos
3 Replies
JiriStrnad
New Contributor II

I have same problem.

JustinMartinek
New Contributor II

I, too, have this issue.  The weird thing is that the type script will transpile into workable javascript artifacts, but this causes build failures due to the type script compiling errors.  I added the typings and api through npm as per the instructions.  Any ideas?

ts.config

{
"compilerOptions": {
"module": "amd",
"noImplicitAny": true,
"sourceMap": true,
"jsx": "react",
"jsxFactory": "tsx",
"target": "es5",
"experimentalDecorators": true,
"preserveConstEnums": true,
"suppressImplicitAnyIndexErrors": true
},
"include": [
"./scripts/esri-widgets/*"
],
"exclude": [
"node_modules",
"wwwroot"
]
}

typescript compile output:

0 Kudos
JoyMiles
New Contributor II

If you haven't had a response yet.

Add the files in the tsconfig.json. It fixed my issue. My application-base-js is in a custom folder at the moment due to a code base issue with npm

"include": [
"./src/**/*"
],
"exclude": [
"./node_modules",
"./tsrules"
],
"files": [
"./node_modules/@types/arcgis-js-api/index.d.ts",
"./node_modules/dojo-typings/dojo/1.11/loader.d.ts",
"./node_modules/dojo-typings/dojo/1.11/index.d.ts",
"./node_modules/dojo-typings/dojo/1.11/modules.d.ts",
"./node_modules/dojo-typings/dijit/1.11/index.d.ts",
"./node_modules/dojo-typings/dijit/1.11/modules.d.ts",
"./node_modules/dojo-typings/dojox/1.11/index.d.ts",
"./node_modules/dojo-typings/dojox/1.11/modules.d.ts",
"./src/libs/@esri/application-base-js/support/updates.d.ts",
"./src/libs/@esri/application-base-js/support/updates.d.ts",
"./src/libs/@esri/application-base-js/index.d.ts",
"./src/libs/@esri/application-base-js/interfaces.d.ts"
]