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

@import style urls in a template throw a cryptic NPE #2611

Closed
TedSander opened this issue Jun 18, 2015 · 5 comments
Closed

@import style urls in a template throw a cryptic NPE #2611

TedSander opened this issue Jun 18, 2015 · 5 comments
Labels
effort1: hours help wanted An issue that is suitable for a community contributor (based on its complexity/scope). type: bug/fix

Comments

@TedSander
Copy link
Contributor

Component with a style tag and an import like so:

<style>@import "material_button.scss.css";</style>

Throws the null pointer below and breaks the app. If the url is made absolute and moved to the styleUrls tag it works as expected. The URL might be invalid, but a better error message would be appreciated at the very least.

The null object does not have a getter 'nextNode'.

NoSuchMethodError: method not found: 'nextNode'
Receiver: null
Arguments: []
STACKTRACE:
#0      LifeCycle.LifeCycle.<anonymous closure> (package:angular2/src/core/life_cycle/life_cycle.dart:47:7)
#1      NgZone._onErrorWithoutLongStackTrace (package:angular2/src/core/zone/ng_zone.dart:194:22)
#2      NgZone.NgZone.<anonymous closure> (package:angular2/src/core/zone/ng_zone.dart:63:36)
#3      _CustomZone.handleUncaughtError (dart:async/zone.dart:785)
#4      _Future._propagateToListeners (dart:async/future_impl.dart:446)
#5      _Future._completeWithValue (dart:async/future_impl.dart:368)
#6      Future.wait.<anonymous closure> (dart:async/future.dart:299)
#7      NgZone._runUnary.<anonymous closure> (package:angular2/src/core/zone/ng_zone.dart:164:40)
#8      _rootRun (dart:async/zone.dart:900)
#9      _ZoneDelegate.run (dart:async/zone.dart:503)
#10     NgZone._run (package:angular2/src/core/zone/ng_zone.dart:144:21)
#11     NgZone._runUnary (package:angular2/src/core/zone/ng_zone.dart:164:7)
#12     _CustomZone.runUnary (dart:async/zone.dart:811)
#13     _Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:494)
#14     _Future._propagateToListeners (dart:async/future_impl.dart:577)
#15     _Future._completeWithValue (dart:async/future_impl.dart:368)
#16     _Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:422)
#17     NgZone._scheduleMicrotask.<anonymous closure> (package:angular2/src/core/zone/ng_zone.dart:173:11)
#18     _rootRun (dart:async/zone.dart:904)
#19     _ZoneDelegate.run (dart:async/zone.dart:503)
#20     NgZone._run (package:angular2/src/core/zone/ng_zone.dart:144:21)
#21     _CustomZone.run (dart:async/zone.dart:803)
#22     _CustomZone.runGuarded (dart:async/zone.dart:709)
#23     _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:734)
#24     _microtaskLoop (dart:async/schedule_microtask.dart:43)
#25     _microtaskLoopEntry (dart:async/schedule_microtask.dart:52)
#26     _ScheduleImmediateHelper._handleMutation (dart:html:42503)

The null object does not have a getter 'nextNode'.

NoSuchMethodError: method not found: 'nextNode'
Receiver: null
Arguments: []
STACKTRACE:
#0      LifeCycle.LifeCycle.<anonymous closure> (package:angular2/src/core/life_cycle/life_cycle.dart:47:7)
#1      NgZone._onErrorWithoutLongStackTrace (package:angular2/src/core/zone/ng_zone.dart:194:22)
#2      NgZone.NgZone.<anonymous closure> (package:angular2/src/core/zone/ng_zone.dart:63:36)
#3      _CustomZone.handleUncaughtError (dart:async/zone.dart:785)
#4      _Future._propagateToListeners (dart:async/future_impl.dart:446)
#5      _Future._completeWithValue (dart:async/future_impl.dart:368)
#6      _Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:422)
#7      NgZone._scheduleMicrotask.<anonymous closure> (package:angular2/src/core/zone/ng_zone.dart:173:11)
#8      _rootRun (dart:async/zone.dart:904)
#9      _ZoneDelegate.run (dart:async/zone.dart:503)
#10     NgZone._run (package:angular2/src/core/zone/ng_zone.dart:144:21)
#11     _CustomZone.run (dart:async/zone.dart:803)
#12     _CustomZone.runGuarded (dart:async/zone.dart:709)
#13     _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:734)
#14     _microtaskLoop (dart:async/schedule_microtask.dart:43)
#15     _microtaskLoopEntry (dart:async/schedule_microtask.dart:52)
#16     _ScheduleImmediateHelper._handleMutation (dart:html:42503)
@vicb
Copy link
Contributor

vicb commented Jun 18, 2015

@TedSander what is the context , transformed / untransformed code ? Do you have a quick repro case ?

@TedSander
Copy link
Contributor Author

Untransformed code. Let me see if I can get a repo case tomorrow the only thing I have right now is part of a larger project I can't share.

@vicb
Copy link
Contributor

vicb commented Jun 18, 2015

It would help to have a repro on vanilla ng2 (judging from the traces, it's not the case).

@mhevery mhevery added hotlist: GT effort1: hours type: bug/fix help wanted An issue that is suitable for a community contributor (based on its complexity/scope). labels Jun 19, 2015
@TedSander
Copy link
Contributor Author

This got closed by another fix. It is fixed at Head.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
effort1: hours help wanted An issue that is suitable for a community contributor (based on its complexity/scope). type: bug/fix
Projects
None yet
Development

No branches or pull requests

3 participants