argon: Error - Cannot find module "."

Hi,

I’m trying to integrate argonjs library in my ionic 2 app. I followed the method which is given in http://docs.argonjs.io/start/setup/. I installed argonjs using npm npm install @argonjs/argon@^1.0. Imported in my ts file, import * as Argon from '@argonjs/argon'. I’m getting Cannot find module "." error when I called init method (Argon.init()).

I am using, Ionic Framework: 2.0.0-rc.5 Ionic Native: 2.2.11 Ionic App Scripts: 1.0.0 Angular Core: 2.2.1 Angular Compiler CLI: 2.2.1 Node: 6.9.1 OS Platform: Windows 7

tsconfig.json: { “compilerOptions”: { “allowSyntheticDefaultImports”: true, “declaration”: false, “emitDecoratorMetadata”: true, “experimentalDecorators”: true, “lib”: [ “dom”, “es2015” ], “module”: “es2015”, “moduleResolution”: “node”, “sourceMap”: true, “target”: “es5” }, “include”: [ “src/**/*.ts” ], “exclude”: [ “node_modules” ], “compileOnSave”: false, “atom”: { “rewriteTsconfig”: false } }

Error message: Runtime Error Cannot find module “.” Stack Error: Cannot find module “.” at webpackMissingModule (http://localhost:8100/build/main.js:97112:3910) at http://localhost:8100/build/main.js:97112:3988 at Object.<anonymous> (http://localhost:8100/build/main.js:97112:4534) at Object.<anonymous> (http://localhost:8100/build/main.js:118068:30) at webpack_require (http://localhost:8100/build/main.js:20:30) at Object.<anonymous> (http://localhost:8100/build/main.js:55840:73) at webpack_require (http://localhost:8100/build/main.js:20:30) at Object.<anonymous> (http://localhost:8100/build/main.js:118078:75) at webpack_require (http://localhost:8100/build/main.js:20:30) at Object.<anonymous> (http://localhost:8100/build/main.js:85858:73)

Please let me know what I’m doing wrong here…

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 17 (9 by maintainers)

Most upvoted comments

It seems that the fix has not yet made it into jspm-cli. Once jspm pulls in this fix, a future release of argon.js should automatically work with the ionic build tools. In the meantime, please try this as a workaround:

Load argon.js manually via a script tag in your html:

<script src="node_modules/@argonjs/argon/dist/argon.js'></script>

And then, instead of importing argon via a import statement, add the following line to your module (where you would normally use import):

/// <reference types="@argonjs/argon" />

After doing this, you should be able to use the @argon/argonjs package via a global Argon variable. Let me know if this works for you!