Solucionado (ver solução)
Solucionado
(ver solução)
5
respostas

Atualizando para IONIC 3

A atualização ocorreu com sucesso, porém o seguinte erro apareceu logo após a mesma no cadastro.ts referente ao alerta, fazendo com que parasse de funcionar tanto no --lab quanto na geração do apk:

C:\Estudos\Cursos\ionic alura\Ionic 2 # 1\projeto\aluraCar>ionic serve --lab

> ionic-hello-world@ ionic:serve C:\Estudos\Cursos\ionic alura\Ionic 2 # 1\projeto\aluraCar
> ionic-app-scripts serve "--v2" "--lab" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"

[23:59:08]  ionic-app-scripts 1.3.7
[23:59:08]  watch started ...
[23:59:08]  build dev started ...
[23:59:08]  clean started ...
[23:59:08]  clean finished in 4 ms
[23:59:08]  copy started ...
[23:59:08]  transpile started ...
[23:59:24]  typescript: ...s/Cursos/ionic alura/Ionic 2 # 1/projeto/aluraCar/src/pages/cadastro/cadastro.ts, line: 37
            Argument of type '{ title: string; buttons: { text: string; handler: () => Promise<any>; }[]; }' is not
            assignable to parameter of type 'AlertOptions'. Types of property 'buttons' are incompatible. Type '{ text:
            string; handler: () => Promise<any>; }[]' is not assignable to type '(string | AlertButton)[]'. Type '{
            text: string; handler: () => Promise<any>; }' is not assignable to type 'string | AlertButton'. Type '{
            text: string; handler: () => Promise<any>; }' is not assignable to type 'AlertButton'. Types of property
            'handler' are incompatible. Type '() => Promise<any>' is not assignable to type '(value: any) => boolean |
            void'. Type 'Promise<any>' is not assignable to type 'boolean | void'. Type 'Promise<any>' is not assignable
            to type 'void'.

      L37:      this._alerta = this._alertCtrl.create({

      L38:        title: 'Aviso',

[23:59:25]  dev server running: http://localhost:8100/

[23:59:27]  copy finished in 18.62 s
[23:59:27]  watch ready in 18.98 s

Ajuda meu querido! Um grande abraço.

5 respostas

Bom dia! Você fez o passo 8 da atualização? É ele que resolve esse problema. No aguardo.

Olá Mestre, fiz e agora o erro é este:

C:\Estudos\Cursos\ionic alura\Ionic 2 # 1\projeto\aluraCar>ionic build android

> ionic-hello-world@ ionic:build C:\Estudos\Cursos\ionic alura\Ionic 2 # 1\projeto\aluraCar
> ionic-app-scripts build

[16:21:47]  ionic-app-scripts 1.3.7
[16:21:47]  build dev started ...
[16:21:47]  clean started ...
[16:21:47]  clean finished in 8 ms
[16:21:47]  copy started ...
[16:21:47]  transpile started ...
[16:22:00]  typescript: ...ic alura/Ionic 2 # 1/projeto/aluraCar/node_modules/@types/localforage/index.d.ts, line: 20
            Interface 'LocalForageDriver' incorrectly extends interface 'LocalForageDbMethods'. Types of property
            'getItem' are incompatible. Type '(key: string, callback: (err: any, value: any) => void) => void' is not
            assignable to type '{ <T>(key: string): Promise<T>; <T>(key: string, callback: (err: any, value: T) =>
            void): void; }'.

      L20:  [16:22:00]  typescript: ...ic alura/Ionic 2 # 1/projeto/aluraCar/node_modules/@types/localforage/index.d.ts, line: 25
    _suppor[16:22:00]  typescript: ...ic alura/Ionic 2 # 1/projeto/aluraCar/node_modules/@types/localforage/index.d.ts, line: 100
t:[16:22:00]  typescript: ...ic alura/Ionic 2 # 1/projeto/aluraCar/src/typings/globals/localforage/index.d.ts, line: 12
boole[16:22:00]  typescript: ...ic alura/Ionic 2 # 1/projeto/aluraCar/src/typings/globals/localforage/index.d.ts, line: 53
an[16:22:00]  typescript: ...ic alura/Ionic 2 # 1/projeto/aluraCar/src/typings/globals/localforage/index.d.ts, line: 53
|[16:22:00]  typescript: ...ic alura/Ionic 2 # 1/projeto/aluraCar/src/typings/globals/localforage/index.d.ts, line: 111
 Promise<boolean>;

            All declarations of '_support' must have identical modifiers.

      L24:      getItem(key: string, callback: (err: any, value: any) => void): void;
      L26:      key(keyIndex: number, callback: (err: any, key: string) => void): void;

            Duplicate identifier 'export='.


            Subsequent variable declarations must have the same type. Variable 'version' must be of type 'string', but
            here has type 'number'.

      L12:      description?: string;

            Subsequent variable declarations must have the same type. Variable '_support' must be of type 'boolean |
            Promise<boolean>', but here has type 'boolean | LocalForageDriverSupportFunc'.

      L54:  interface LocalForageSerializer {

            All declarations of '_support' must have identical modifiers.

      L54:  interface LocalForageSerializer {

            Duplicate identifier 'export='.


[16:22:00]  ionic-app-script task: "build"
[16:22:00]  Error: Failed to transpile program
Error: Failed to transpile program
    at BuildError.Error (native)
    at new BuildError (C:\Estudos\Cursos\ionic alura\Ionic 2 # 1\projeto\aluraCar\node_modules\@ionic\app-scripts\dist\util\errors.js:16:28)
    at C:\Estudos\Cursos\ionic alura\Ionic 2 # 1\projeto\aluraCar\node_modules\@ionic\app-scripts\dist\transpile.js:137:20
    at transpileWorker (C:\Estudos\Cursos\ionic alura\Ionic 2 # 1\projeto\aluraCar\node_modules\@ionic\app-scripts\dist\transpile.js:103:12)
    at Object.transpile (C:\Estudos\Cursos\ionic alura\Ionic 2 # 1\projeto\aluraCar\node_modules\@ionic\app-scripts\dist\transpile.js:61:12)
    at buildProject (C:\Estudos\Cursos\ionic alura\Ionic 2 # 1\projeto\aluraCar\node_modules\@ionic\app-scripts\dist\build.js:97:78)
    at C:\Estudos\Cursos\ionic alura\Ionic 2 # 1\projeto\aluraCar\node_modules\@ionic\app-scripts\dist\build.js:47:16
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ionic-hello-world@ ionic:build: `ionic-app-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ionic-hello-world@ ionic:build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Giulliana\AppData\Roaming\npm-cache\_logs\2017-08-01T19_22_00_467Z-debug.log

C:\Estudos\Cursos\ionic alura\Ionic 2 # 1\projeto\aluraCar>ionic serve --lab

> ionic-hello-world@ ionic:serve C:\Estudos\Cursos\ionic alura\Ionic 2 # 1\projeto\aluraCar
> ionic-app-scripts serve "--v2" "--lab" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"

[16:23:07]  ionic-app-scripts 1.3.7
[16:23:07]  watch started ...
[16:23:07]  build dev started ...
[16:23:08]  clean started ...
[16:23:08]  clean finished in 5 ms
[16:23:08]  copy started ...
[16:23:08]  transpile started ...
[16:23:16]  typescript: ...ic alura/Ionic 2 # 1/projeto/aluraCar/node_modules/@types/localforage/index.d.ts, line: 20
            Interface 'LocalForageDriver' incorrectly extends interface 'LocalForageDbMethods'. Types of property
            'getItem' are incompatible. Type '(key: string, callback: (err: any, value: any) => void) => void' is not
            assignable to type '{ <T>(key: string): Promise<T>; <T>(key: string, callback: (err: any, value: T) =>
            void): void; }'.

      L20:      _support:[16:23:16]  typescript: ...ic alura/Ionic 2 # 1/projeto/aluraCar/node_modules/@types/localforage/index.d.ts, line: 25
  boolean |
 [16:23:16]  typescript: ...ic alura/Ionic 2 # 1/projeto/aluraCar/node_modules/@types/localforage/index.d.ts, line: 100
Promise<boolean>;

            All declarations of '_support' must have identical modifiers.

      L24:      getItem(key: string, callback: (err: any, value: any) => void): void;
      L26:      key(keyIndex: number, callback: (err: any, key: string) => void): void;

            Duplicate identifier 'export='.


[16:23:16]  typescript: ...ic alura/Ionic 2 # 1/projeto/aluraCar/src/typings/globals/localforage/index.d.ts, line: 12
            Subsequent variable declarations must have the same type. Variable 'version' must be of type 'string', but
            here has type 'number'.

      L12:  [16:23:16]  typescript: ...ic alura/Ionic 2 # 1/projeto/aluraCar/src/typings/globals/localforage/index.d.ts, line: 53
description?: string;

            Subsequent variable declarations must have the same type. Variable '_support' must be of type 'boolean |
            Promise<boolean>', but here has type 'boolean | LocalForageDriverSupportFunc'.

      L54:  interface LocalForageSerializer {

[16:23:16]  typescript: ...ic alura/Ionic 2 # 1/projeto/aluraCar/src/typings/globals/localforage/index.d.ts, line: 53
            All declarations of '_support' must have identical modifiers.

      L54:  [16:23:16]  typescript: ...ic alura/Ionic 2 # 1/projeto/aluraCar/src/typings/globals/localforage/index.d.ts, line: 111 interface L
ocalForageSerializer {


            Duplicate identifier 'export='.


[16:23:16]  dev server running: http://localhost:8100/

[16:23:18]  copy finished in 10.36 s
[16:23:18]  watch ready in 10.68 s

Olá eu removi a pasta typings da pasta src, porém o erro agora é este:

Runtime Error
Cannot find module "localforage"

Stack
Error: Cannot find module "localforage"
    at Object.<anonymous> (http://localhost:8100/build/main.js:104918:7)
    at __webpack_require__ (http://localhost:8100/build/main.js:20:30)
    at Object.<anonymous> (http://localhost:8100/build/main.js:59700:67)
    at __webpack_require__ (http://localhost:8100/build/main.js:20:30)
    at Object.<anonymous> (http://localhost:8100/build/main.js:47461:73)
    at __webpack_require__ (http://localhost:8100/build/main.js:20:30)
    at Object.<anonymous> (http://localhost:8100/build/main.js:58329:94)
    at __webpack_require__ (http://localhost:8100/build/main.js:20:30)
    at Object.<anonymous> (http://localhost:8100/build/main.js:77845:91)
    at __webpack_require__ (http://localhost:8100/build/main.js:20:30)
Ionic Framework: 3.4.2

Ionic Framework: 3.4.2
Ionic Native: 2.9.0
Ionic App Scripts: 1.3.7
Angular Core: 4.1.3
Angular Compiler CLI: 4.1.3
Node: 6.11.2
OS Platform: Windows 7
Navigator Platform: Win32
User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36

Obs: npm -v = 5.0.3

Obrigado.

solução!

Consegui resolver assim:

npm install localforage

Depois ele solicitou o módulo localforage-cordovasqlitedriver, aí foi só instalar que deu tudo certo.

 npm install localforage-cordovasqlitedriver

Obrigado Mestre e espero que sirva pra alguém essa solução.

Oi Welber! Ficará registrada aqui. Excelente que conseguiu resolver!

Sucesso e bom estudo meu aluno!