Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.

2 classes in the same ts file breaks the script #796

Open
pacMakaveli opened this issue Mar 7, 2017 · 0 comments
Open

2 classes in the same ts file breaks the script #796

pacMakaveli opened this issue Mar 7, 2017 · 0 comments

Comments

@pacMakaveli
Copy link

pacMakaveli commented Mar 7, 2017

Short description of the problem:

Having 2 classes in the same typescript file seems to break the ionic serve command.
This is on a project that is being ported from Ionic beta.11 to latest.. which worked before.

What behavior are you expecting?

No issues compiling the app.

Steps to reproduce:

import { Component } from '@angular/core';

@Component({
  templateUrl: 'location.html'
})

export class LocationPage {
  constructor() { }
}

@Component({
  templateUrl: 'location-floorplan.html'
})

export class LocationFloorplanPage {
  constructor() { }
}

Which @ionic/app-scripts version are you using?
1.1.3

Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)

-> % ionic serve -c -l

> mychubit@ ionic:serve /Users/vladsmarteditors/Projects/smarteditors/clients/gogreen/myChubit-app
> ionic-app-scripts serve "--v2" "--consolelogs" "--lab" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"

[13:19:12]  ionic-app-scripts 1.1.3
[13:19:12]  watch started ...
[13:19:12]  build dev started ...
[13:19:12]  clean started ...
[13:19:12]  clean finished in 2 ms
[13:19:12]  copy started ...
[13:19:12]  transpile started ...
[13:19:18]  transpile finished in 6.11 s
[13:19:18]  preprocess started ...
[13:19:18]  preprocess finished in 1 ms
[13:19:18]  webpack started ...
[13:19:18]  copy finished in 6.39 s
/Users/vladsmarteditors/Projects/smarteditors/clients/gogreen/myChubit-app/node_modules/webpack-sources/node_modules/source-map/lib/source-node.js:95
          var code = nextLine.substr(0, mapping.generatedColumn -
                             ^

TypeError: Cannot read property 'substr' of undefined
    at Function.<anonymous> (/Users/vladsmarteditors/Projects/smarteditors/clients/gogreen/myChubit-app/node_modules/webpack-sources/node_modules/source-map/lib/source-node.js:95:30)
    at Array.forEach (native)
    at SourceMapConsumer_eachMapping [as eachMapping] (/Users/vladsmarteditors/Projects/smarteditors/clients/gogreen/myChubit-app/node_modules/webpack-sources/node_modules/source-map/lib/source-map-consumer.js:155:14)
    at Function.SourceNode_fromStringWithSourceMap [as fromStringWithSourceMap] (/Users/vladsmarteditors/Projects/smarteditors/clients/gogreen/myChubit-app/node_modules/webpack-sources/node_modules/source-map/lib/source-node.js:80:24)
    at SourceMapSource.node (/Users/vladsmarteditors/Projects/smarteditors/clients/gogreen/myChubit-app/node_modules/webpack-sources/lib/SourceMapSource.js:42:20)
    at ReplaceSource.node (/Users/vladsmarteditors/Projects/smarteditors/clients/gogreen/myChubit-app/node_modules/webpack-sources/lib/ReplaceSource.js:69:29)
    at CachedSource.node (/Users/vladsmarteditors/Projects/smarteditors/clients/gogreen/myChubit-app/node_modules/webpack-sources/lib/CachedSource.js:12:23)
    at /Users/vladsmarteditors/Projects/smarteditors/clients/gogreen/myChubit-app/node_modules/webpack-sources/lib/ConcatSource.js:40:49
    at Array.map (native)
    at ConcatSource.node (/Users/vladsmarteditors/Projects/smarteditors/clients/gogreen/myChubit-app/node_modules/webpack-sources/lib/ConcatSource.js:39:60)

npm ERR! Darwin 16.4.0
npm ERR! argv "/Users/vladsmarteditors/.nvm/versions/node/v6.9.2/bin/node" "/Users/vladsmarteditors/.nvm/versions/node/v6.9.2/bin/npm" "run" "ionic:serve" "--" "--v2" "--consolelogs" "--lab" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"
npm ERR! node v6.9.2
npm ERR! npm  v4.1.1
npm ERR! code ELIFECYCLE
npm ERR! mychubit@ ionic:serve: `ionic-app-scripts serve "--v2" "--consolelogs" "--lab" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mychubit@ ionic:serve script 'ionic-app-scripts serve "--v2" "--consolelogs" "--lab" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the mychubit package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     ionic-app-scripts serve "--v2" "--consolelogs" "--lab" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs mychubit
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls mychubit
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/vladsmarteditors/Projects/smarteditors/clients/gogreen/myChubit-app/npm-debug.log
There was an error serving your Ionic application: There was an error with the spawned command: serve

Might be related: mozilla/source-map#247

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants