Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependicies and #4

Closed
nowrap opened this issue Feb 26, 2019 · 10 comments
Closed

Dependicies and #4

nowrap opened this issue Feb 26, 2019 · 10 comments
Assignees

Comments

@nowrap
Copy link

nowrap commented Feb 26, 2019

Hello,
today i've added your package to my ionic 3 app.

With npm i am getting dependencie errors:
npm WARN @angular/platform-browser@5.0.3 requires a peer of @angular/core@5.0.3 bu t none is installed. You must install peer dependencies yourself. npm WARN @angular/platform-browser@5.0.3 requires a peer of @angular/common@5.0.3 but none is installed. You must install peer dependencies yourself. npm WARN @angular/platform-browser-dynamic@5.0.3 requires a peer of @angular/core@ 5.0.3 but none is installed. You must install peer dependencies yourself. npm WARN @angular/platform-browser-dynamic@5.0.3 requires a peer of @angular/commo n@5.0.3 but none is installed. You must install peer dependencies yourself. npm WARN @angular/platform-browser-dynamic@5.0.3 requires a peer of @angular/compi ler@5.0.3 but none is installed. You must install peer dependencies yourself.

Within app.module.ts i am getting a build error
`Argument of type 'Platform' is not assignable to parameter of type 'Platform'. Types have separate declarations of a private property '_win'.

  L47:    return new LogProvider(file, platform, datePipe, new LogProviderConf

ig({/your config here/}));
`

Do you have any advices?

Regards
.nowrap

@y-a-n-n
Copy link
Contributor

y-a-n-n commented Feb 26, 2019

Hi, thanks for bringing this to my attention.

Issue 1: I have updated some of the mismatched dependencies and will release an updated today so that those errors no longer appear. You may still see the following:

npm WARN ajv-keywords@3.4.0 requires a peer of ajv@^6.9.1 but none is installed. You must install peer dependencies yourself.

Related to this issue: ajv-validator/ajv#708

But this has no effect on functionality, so can be safely ignored in this case.

Issue 2: How are you importing Platform? In the imports at the top of your app.module where you are instantiating the LogProvider, you should have:

import {Platform} from 'ionic-angular';

The error you're getting suggests you're importing something else called Platform

@nowrap
Copy link
Author

nowrap commented Feb 27, 2019

Hello,
thanx for your help.

Issue 1 is solved ;)

npm install --save ionic-log-file-appender
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

  • ionic-log-file-appender@1.1.2

My import for Issue 2 is:
import { IonicApp, IonicErrorHandler, IonicModule, Platform } from 'ionic-angular';
(Webstorm managed the import automatically)

That's why i am a bit puzzled. Following your LogProvider constructor, it looks correct:
import { Platform } from 'ionic-angular';

But Webstorm shows already an error in the app.module.ts file!

TS2345: Argument of type 'Platform' is not assignable to parameter of type 'Platform'.   Types have separate declarations of a private property '_win'.

Strange indeed

// edit:
Following the definitions, shows 2 different files:
my - node_modules/ionic-angular/platform/platform.d.ts
yours - node_modules/ionic-log-file-appender/node_modules/ionic-angular/platform/platform.d.ts

@y-a-n-n
Copy link
Contributor

y-a-n-n commented Feb 27, 2019

Interesting. I haven't been able to repro this even after playing with my dependency versions, but after some searching found these, which look like the same issue:

microsoft/TypeScript#8346
microsoft/TypeScript#11436

What version of typescript are you using?

@nowrap
Copy link
Author

nowrap commented Feb 27, 2019

local typescript is version 2.6.2

@y-a-n-n
Copy link
Contributor

y-a-n-n commented Feb 27, 2019

That's the same version as I'm using in my projects which use this package.

I'm a little stumped then. Apart from a clean npm install, I'm not sure what to recommend to you...

@y-a-n-n
Copy link
Contributor

y-a-n-n commented Feb 28, 2019

Can you try something like this answer?

microsoft/TypeScript#6496 (comment)

@nowrap
Copy link
Author

nowrap commented Feb 28, 2019

Hello,
thanks for researching!

I removed the node_modules folder and tried a "npm install".
Still the same result.

I added the lines from your link to my tsconfig.json.
Still the same result.

{
  "compilerOptions": {
    "allowSyntheticDefaultImports": true,
    "declaration": false,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "lib": [
      "dom",
      "es7"
    ],
    "module": "es2015",
    "moduleResolution": "node",
    "sourceMap": true,
    "target": "es5",
    "baseUrl": "./",
    "paths": {
      "*": [
        "node_modules/@types/*",
        "*"
      ]
    }
  },
  "include": [
    "src/**/*.ts"
  ],
  "exclude": [
    "node_modules",
    "src/**/*.spec.ts",
    "src/**/__tests__/*.ts"
  ],
  "compileOnSave": false,
  "atom": {
    "rewriteTsconfig": false
  }
}

I'try it on my mac later.

@y-a-n-n
Copy link
Contributor

y-a-n-n commented Mar 6, 2019

@nowrap, I've managed to repro something similar using a fresh ionic starter. Did you end up getting this resolved or have a solution before I investigate further?

@y-a-n-n y-a-n-n self-assigned this Mar 6, 2019
@y-a-n-n
Copy link
Contributor

y-a-n-n commented Mar 6, 2019

@nowrap: I managed to resolve the issue by adding the following to my tsconfig.json:

"compilerOptions": { "baseUrl": "./", "paths": { "@ionic-native/file": ["node_modules/@ionic-native/file"], "@ionic-native/file/*": ["node_modules/@ionic-native/file/*"], "ionic-angular": ["node_modules/ionic-angular/"], "ionic-angular/*": ["node_modules/ionic-angular/*"] },

I think the ultimate solution is to make this package a module, but see if this gets you up and running for now

@no-response
Copy link

no-response bot commented Mar 20, 2019

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

@no-response no-response bot closed this as completed Mar 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants