You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 1, 2020. It is now read-only.
Repository navigation
This repository was archived by the owner on May 1, 2020. It is now read-only.
There is also error caused by webpack-sources #562
I was facing the same issue and isolated the problem to multiple components within same .ts file. in my RC3 project.
Update: More specifically this occurs when the second component within the .ts file uses a templateUrl as opposed to template for its decoration.
Applied the single responsibility principle from Angular and separated the components into their respective .ts files to resolve the original issue reported here.
Nice work. I also have multiple components in the same file. Thanks for going through the trouble of isolating it. I think i'll just separate them now considering I had another issue in a previous version of ionic related to this. Might as well stick with the crowd because they don't really test this internally.
Edit: Separating them into individual files worked for me.
I'm slightly confused by the suggested fix here. It seems to be breaking when there are multiple components within the same .ts file, but that isn't strictly prohibited by Angular 2, right? So this is still a valid bug. Or am I missing something?
Yes it's still a valid bug that needs addressing. I was just saying that I have had an issue with exactly multiple components within in a single file in the past. #115
This was later fixed and now another issue is cropping up. I'd rather stick with the style guide rather than facing more issues in the future because I don't think they test it internally.
I'm sure someone will come and take a look at it now that we have found a way to reproduce it.
I think I stumbled upon another workaround, which does not require modification of any source files. As documented here, I added the following to my package.json:
"config": {
"ionic_source_map_type": "eval"
}
According to the docs, this will change some webpack option, which defaults to source-map, thus probably triggering the error. Now, I have absolutely no clue what eval does (or webpack in general, for that matter), but for the moment I'm happy enough that I can run ionic serve with app-scripts 0.0.47!
And yes, I (seldomly) do put multiple components in one .ts file; for example, I like to place popups/context menus, which are only a few lines, in the same file as their "parent" page. You may argue about style here, but a build tool still shouldn't croak on this...
I think we'll have some problems indefinitely with multiple components, etc in one file. I don't recommend that right now. We'll fix eventually but bigger fish to fry first.
@danbucholtz: If that's really been identified as the cause of this issue, that would be fine with me. It's still an RC, after all. I'd just like to see this stated prominently in a list of known bugs/limitations in the release notes.
The ionic2-rc.4 branch should be up to date and contains the ionic_source_map_type: eval workaround, and npm run ionic:build works just fine.
The ionic2-rc.4-source-map branch sets ionic_source_map_type to source-map (the default according to the docs), and ionic:build aborts with the TypeError.
There's also a Travis CI build for the latter that shows the same behavior: https://travis-ci.org/tkem/openlap/builds/185582821
It's quite verbose, so it should also give you enough info about the build environment.
Can someone explain this to me like I'm 5? Sorry, I am not up to speed on this. Is this due to multiple components in the same file? If so, I recommend not doing that for now 😸
Activity
[-]There is also error coused by webpack-sources[/-][+]There is also error caused by webpack-sources[/+]danbucholtz commentedon Dec 15, 2016
Hi @Spaha,
Can you provide some more details or a repo demonstrating the issue?
Thanks,
Dan
herbzi commentedon Dec 16, 2016
+1
I also had this problem and struggled to find any information on what could be causing it. I had to revert to .46 .
stewones commentedon Dec 16, 2016
ionic-team/ionic-framework#9658 (comment)
parkbytes commentedon Dec 17, 2016
I was facing the same issue and isolated the problem to multiple components within same .ts file. in my RC3 project.
Update: More specifically this occurs when the second component within the .ts file uses a templateUrl as opposed to template for its decoration.
Applied the single responsibility principle from Angular and separated the components into their respective .ts files to resolve the original issue reported here.
https://angular.io/docs/ts/latest/guide/style-guide.html#!#single-responsibility
I was able to narrow down the issue by manually migrating old rc3 project (part by part) to a freshly created rc4 project.!!!
Maybe the experts can confirm.
herbzi commentedon Dec 18, 2016
Nice work. I also have multiple components in the same file. Thanks for going through the trouble of isolating it. I think i'll just separate them now considering I had another issue in a previous version of ionic related to this. Might as well stick with the crowd because they don't really test this internally.
Edit: Separating them into individual files worked for me.
coreymcmahon commentedon Dec 19, 2016
I'm slightly confused by the suggested fix here. It seems to be breaking when there are multiple components within the same
.tsfile, but that isn't strictly prohibited by Angular 2, right? So this is still a valid bug. Or am I missing something?herbzi commentedon Dec 19, 2016
Yes it's still a valid bug that needs addressing. I was just saying that I have had an issue with exactly multiple components within in a single file in the past. #115
This was later fixed and now another issue is cropping up. I'd rather stick with the style guide rather than facing more issues in the future because I don't think they test it internally.
I'm sure someone will come and take a look at it now that we have found a way to reproduce it.
tkem commentedon Dec 19, 2016
I think I stumbled upon another workaround, which does not require modification of any source files. As documented here, I added the following to my
package.json:According to the docs, this will change some
webpackoption, which defaults tosource-map, thus probably triggering the error. Now, I have absolutely no clue whatevaldoes (orwebpackin general, for that matter), but for the moment I'm happy enough that I can runionic servewith app-scripts 0.0.47!And yes, I (seldomly) do put multiple components in one
.tsfile; for example, I like to place popups/context menus, which are only a few lines, in the same file as their "parent" page. You may argue about style here, but a build tool still shouldn't croak on this...murshid1988 commentedon Dec 20, 2016
@tkem This worked for me too. But like you said, this is not a proper fix
danbucholtz commentedon Dec 20, 2016
@tkem,
I think we'll have some problems indefinitely with multiple components, etc in one file. I don't recommend that right now. We'll fix eventually but bigger fish to fry first.
Thanks,
Dan
tkem commentedon Dec 20, 2016
@danbucholtz: If that's really been identified as the cause of this issue, that would be fine with me. It's still an RC, after all. I'd just like to see this stated prominently in a list of known bugs/limitations in the release notes.
danbucholtz commentedon Dec 20, 2016
@tkem,
I've never actually seen this issue and it's not a popular one so it probably isn't happening for many people. I need to look into it more.
Thanks,
Dan
Trigger ionic-team/ionic-app-scripts#562.
tkem commentedon Dec 20, 2016
@danbucholtz: Sure. If you're still looking for a public repo for this: https://github.com/tkem/openlap
The
ionic2-rc.4branch should be up to date and contains theionic_source_map_type: evalworkaround, andnpm run ionic:buildworks just fine.The
ionic2-rc.4-source-mapbranch setsionic_source_map_typetosource-map(the default according to the docs), andionic:buildaborts with theTypeError.There's also a Travis CI build for the latter that shows the same behavior:
https://travis-ci.org/tkem/openlap/builds/185582821
It's quite verbose, so it should also give you enough info about the build environment.
Hope that helps somewhat,
Thomas
danbucholtz commentedon Jan 5, 2017
Can someone explain this to me like I'm 5? Sorry, I am not up to speed on this. Is this due to multiple components in the same file? If so, I recommend not doing that for now 😸
Thanks,
Dan
danbucholtz commentedon Jan 28, 2017
Due to lack of response, I'm going to close this issue. I was never able to recreate or understand what was happening.
Please open another issue if needed.
Thanks,
Dan