cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roy Ackermann (JIRA)" <>
Subject [jira] [Created] (CB-13526) Error: "Cannot find name 'device'." in a Angular 4 Project while running ng build.
Date Thu, 02 Nov 2017 11:05:00 GMT
Roy Ackermann created CB-13526:

             Summary: Error: "Cannot find name 'device'."  in a Angular 4 Project while running
ng build.
                 Key: CB-13526
             Project: Apache Cordova
          Issue Type: Bug
          Components: cordova-plugin-device
         Environment: cordova-plugin-file: 4.3.3
cordova: 7.0.1
Desktop: Windows 10

            Reporter: Roy Ackermann
            Priority: Blocking

I would like to load an Angular 4 project with Cordova. For this,  I build my Amngular App
with ng build and copy it into the /WWW directory of Cordova. This works so far.

Now I have installed the file plugin in the cordova project. In addition, I have installed
the NPM module @types/cordova-plugin-file to the angular project, where the type definitions
are inclued.

the structure: 
- cordova projekt-root
---   node_modules
---   www
---   plugins
------   cordova-file-plugin
---   ......
---   angular projekt-root
------  node_modules
---------  @types
------------  cordova-file-plugin
------  src
------  tsconfig.json
------  .....

Here are the typesRoots Part of my tsconfig.json file, wich include all index.d.ts files from
the"node_modules/@types" folder.

  "typeRoots": [

It works for example for jJQuery or other libraries. But not for all cordova plugins. Because,
in the index.d.ts files from cordova plugins, there are no exports. There are ony declarations
from variables. But not exported. 

When i run ng build, i get the error  "Cannot find name 'device'." Is there an error in the
typedefinitions from the cordova plugins? 

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message