Skip to content

[plain JS] templateUrl not working with short path #1901

Open
@atao60

Description

@atao60

When reporting a bug, please be sure to include the following:

  • A descriptive title
  • An isolated way to reproduce the behavior (example: GitHub repository with code isolated to the issue that anyone can clone to observe the problem)
  • What version of angular-meteor you're using, and the platform(s) you're running it on
  • What packages or other dependencies you're using
  • The behavior you expect to see, and the actual behavior

bug?

A working demo is available on atao60/meteor-angular-ionic. This demo is based on Angular Meteor bare. All the code (but the tests) is in plain JS, even the annotations (Component, NgModule,...)

As soon as a path such as:

templateUrl: 'client/imports/app/app.html'

is replaced by:

templateUrl: 'app.html'

the associated part of the view isn't correctly displayed.

Is this the expected behavior with vanilla JS w/o "@" annotations, ie full pathes required?

Should it be possible to keep the same behavior than with TS and "@" annotations, ie short pathes accepted?

dev config

$ uname -srvmpio
Linux 4.13.0-37-generic #42~16.04.1-Ubuntu SMP Wed Mar 7 16:03:28 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

$ cat package.json
{
  "private": true,
  "scripts": {
    "start": "meteor run",
    "test": "TEST_BROWSER_DRIVER=phantomjs meteor test --driver-package=ardatan:mocha",
    "test:ci": "TEST_BROWSER_DRIVER=phantomjs meteor test --driver-package=ardatan:mocha --once",
    "postinstall": "npm run styles:install",
    "prestyles:install": "mkdirp ./client/stylesheets",
    "styles:install": "npm run ionic-styles:install",
    "ionic-styles:install": "cpy node_modules/ionic-angular/css/ionic.css client/stylesheets"
  },
  "dependencies": {
    "@angular/common": "^5.2.9",
    "@angular/compiler": "^5.2.9",
    "@angular/core": "^5.2.9",
    "@angular/forms": "^5.2.9",
    "@angular/platform-browser": "^5.2.9",
    "@angular/platform-browser-dynamic": "^5.2.9",
    "@angular/router": "^5.2.9",
    "@babel/runtime": "^7.0.0-beta.42",
    "@ionic-native/core": "^4.6.0",
    "core-js": "^2.5.3",
    "ionic-angular": "^3.9.2",
    "meteor-node-stubs": "~0.3.3",
    "meteor-rxjs": "^0.4.10",
    "rxjs": "^5.5.7",
    "zone.js": "^0.8.20"
  },
  "devDependencies": {
    "@angular/compiler-cli": "^5.2.9",
    "@types/chai": "^4.1.2",
    "@types/meteor": "^1.4.13",
    "@types/mocha": "^2.2.48",
    "@types/sinon": "^4.3.0",
    "chai": "^4.1.2",
    "cpy-cli": "^1.0.1",
    "mkdirp": "^0.5.1",
    "phantomjs-prebuilt": "^2.1.16",
    "sinon": "^4.4.6",
    "typescript": "^2.7.2"
  }
}

$ cat .meteor/release
METEOR@1.6.1

$ cat .meteor/packages
# Meteor packages used by this project, one per line.
# Check this file (and the other files in this directory) into your repository.
#
# 'meteor add' and 'meteor remove' will edit this file for you,
# but you can also edit it by hand.

meteor-base@1.3.0             # Packages every Meteor app needs to have
mobile-experience@1.0.5       # Packages for a great mobile UX
mongo@1.4.2                   # The database Meteor supports right now
reactive-var@1.0.11            # Reactive variable for tracker
tracker@1.1.3                 # Meteor's client-side reactive programming library

es5-shim@4.7.0                # ECMAScript 5 compatibility for older browsers
ecmascript@0.10.0              # Enable ECMAScript2015+ syntax in app code
shell-server@0.3.1            # Server-side component of the `meteor shell` command

angular-compilers

$ cat .meteor/versions
allow-deny@1.1.0
angular-compilers@0.3.1
angular-html-compiler@0.3.1
angular-scss-compiler@0.3.1
angular-typescript-compiler@0.3.1
autoupdate@1.4.0
babel-compiler@7.0.5
babel-runtime@1.2.2
base64@1.0.11
binary-heap@1.0.10
boilerplate-generator@1.4.0
callback-hook@1.1.0
check@1.3.1
ddp@1.4.0
ddp-client@2.3.2
ddp-common@1.4.0
ddp-server@2.1.2
diff-sequence@1.1.0
dynamic-import@0.3.0
ecmascript@0.10.5
ecmascript-runtime@0.5.0
ecmascript-runtime-client@0.6.2
ecmascript-runtime-server@0.5.0
ejson@1.1.0
es5-shim@4.7.3
geojson-utils@1.0.10
hot-code-push@1.0.4
http@1.4.0
id-map@1.1.0
launch-screen@1.1.1
livedata@1.0.18
logging@1.1.20
meteor@1.8.6
meteor-base@1.3.0
minimongo@1.4.3
mobile-experience@1.0.5
mobile-status-bar@1.0.14
modules@0.11.5
modules-runtime@0.9.2
mongo@1.4.5
mongo-dev-server@1.1.0
mongo-id@1.0.7
npm-mongo@2.2.34
ordered-dict@1.1.0
promise@0.10.2
random@1.1.0
reactive-var@1.0.11
reload@1.2.0
retry@1.1.0
routepolicy@1.0.13
server-render@0.3.0
shell-server@0.3.1
shim-common@0.1.0
socket-stream-client@0.1.0
tracker@1.1.3
underscore@1.0.10
url@1.2.0
webapp@1.5.0
webapp-hashing@1.0.9

UPDATE

After a very long time, error messages are displayed on the browser console:

ERROR 
InternalError: too much recursion
Stack trace:
[object Object]
AppComponent.ngfactory.js:22:24
View_AppComponent_0
ng:///AppModule/AppComponent.ngfactory.js:22:24
proxyClass
http://localhost:3000/packages/modules.js:100440:20
core.umd.js/</DebugContext_</DebugContext_.prototype.logError
http://localhost:3000/packages/modules.js:80662:11
core.umd.js/</ErrorHandler</ErrorHandler.prototype.handleError
http://localhost:3000/packages/modules.js:67175:9
core.umd.js/</ApplicationRef</ApplicationRef.prototype.tick/<
http://localhost:3000/packages/modules.js:71580:63
zone.js/</Zone$1</ZoneDelegate</ZoneDelegate.prototype.invoke
http://localhost:3000/packages/modules.js:55841:17
zone.js/</Zone$1</Zone</Zone.prototype.run
http://localhost:3000/packages/modules.js:55591:24
core.umd.js/</NgZone</NgZone.prototype.runOutsideAngular
http://localhost:3000/packages/modules.js:70363:54
core.umd.js/</ApplicationRef</ApplicationRef.prototype.tick
http://localhost:3000/packages/modules.js:71580:13
core.umd.js/</ApplicationRef</ApplicationRef.prototype._loadComponent
http://localhost:3000/packages/modules.js:71639:9
core.umd.js/</ApplicationRef</ApplicationRef.prototype.bootstrap
http://localhost:3000/packages/modules.js:71527:9
core.umd.js/</PlatformRef</PlatformRef.prototype._moduleDoBootstrap/<
http://localhost:3000/packages/modules.js:71247:74
core.umd.js/</PlatformRef</PlatformRef.prototype._moduleDoBootstrap
http://localhost:3000/packages/modules.js:71247:13
core.umd.js/</PlatformRef</PlatformRef.prototype.bootstrapModuleFactory/</</<
http://localhost:3000/packages/modules.js:71168:21
zone.js/</Zone$1</ZoneDelegate</ZoneDelegate.prototype.invoke
http://localhost:3000/packages/modules.js:55841:17
onInvoke
http://localhost:3000/packages/modules.js:70415:24
zone.js/</Zone$1</ZoneDelegate</ZoneDelegate.prototype.invoke
http://localhost:3000/packages/modules.js:55840:17
zone.js/</Zone$1</Zone</Zone.prototype.run
http://localhost:3000/packages/modules.js:55591:24
scheduleResolveOrReject/<
http://localhost:3000/packages/modules.js:56311:52
zone.js/</Zone$1</ZoneDelegate</ZoneDelegate.prototype.invokeTask
http://localhost:3000/packages/modules.js:55874:17
onInvokeTask
http://localhost:3000/packages/modules.js:70406:24
zone.js/</Zone$1</ZoneDelegate</ZoneDelegate.prototype.invokeTask
http://localhost:3000/packages/modules.js:55873:17
zone.js/</Zone$1</Zone</Zone.prototype.runTask
http://localhost:3000/packages/modules.js:55641:28
drainMicroTaskQueue
http://localhost:3000/packages/modules.js:56048:25
zone.js/</Zone$1</ZoneTask</ZoneTask.invokeTask
http://localhost:3000/packages/modules.js:55953:21
invokeTask
http://localhost:3000/packages/modules.js:56970:9
globalZoneAwareCallback
http://localhost:3000/packages/modules.js:56996:17
ERROR CONTEXT 
Object { view: {…}, nodeIndex: 18, nodeDef: {…}, elDef: {…}, elView: {…} }
AppComponent.ngfactory.js:22:24
Angular is running in the development mode. Call enableProdMode() to enable the production mode.
modules.js:69353:9

ERROR CONTEXT Object { view: {…}, nodeIndex: 18, nodeDef: {…}, elDef: {…}, elView: {…} } AppComponent.ngfactory.js:22:24
	View_AppComponent_0 ng:///AppModule/AppComponent.ngfactory.js:22:24
	proxyClass http://localhost:3000/packages/modules.js:100440:20
	core.umd.js/</DebugContext_</DebugContext_.prototype.logError http://localhost:3000/packages/modules.js:80662:11
	core.umd.js/</ErrorHandler</ErrorHandler.prototype.handleError http://localhost:3000/packages/modules.js:67180:13
	core.umd.js/</ApplicationRef</ApplicationRef.prototype.tick/< http://localhost:3000/packages/modules.js:71580:63
	zone.js/</Zone$1</ZoneDelegate</ZoneDelegate.prototype.invoke http://localhost:3000/packages/modules.js:55841:17
	zone.js/</Zone$1</Zone</Zone.prototype.run http://localhost:3000/packages/modules.js:55591:24
	core.umd.js/</NgZone</NgZone.prototype.runOutsideAngular http://localhost:3000/packages/modules.js:70363:54
	core.umd.js/</ApplicationRef</ApplicationRef.prototype.tick http://localhost:3000/packages/modules.js:71580:13
	core.umd.js/</ApplicationRef</ApplicationRef.prototype._loadComponent http://localhost:3000/packages/modules.js:71639:9
	core.umd.js/</ApplicationRef</ApplicationRef.prototype.bootstrap http://localhost:3000/packages/modules.js:71527:9
	core.umd.js/</PlatformRef</PlatformRef.prototype._moduleDoBootstrap/< http://localhost:3000/packages/modules.js:71247:74
	core.umd.js/</PlatformRef</PlatformRef.prototype._moduleDoBootstrap http://localhost:3000/packages/modules.js:71247:13
	core.umd.js/</PlatformRef</PlatformRef.prototype.bootstrapModuleFactory/</</< http://localhost:3000/packages/modules.js:71168:21
	zone.js/</Zone$1</ZoneDelegate</ZoneDelegate.prototype.invoke http://localhost:3000/packages/modules.js:55841:17
	onInvoke http://localhost:3000/packages/modules.js:70415:24
	zone.js/</Zone$1</ZoneDelegate</ZoneDelegate.prototype.invoke http://localhost:3000/packages/modules.js:55840:17
	zone.js/</Zone$1</Zone</Zone.prototype.run http://localhost:3000/packages/modules.js:55591:24
	scheduleResolveOrReject/< http://localhost:3000/packages/modules.js:56311:52
	zone.js/</Zone$1</ZoneDelegate</ZoneDelegate.prototype.invokeTask http://localhost:3000/packages/modules.js:55874:17
	onInvokeTask http://localhost:3000/packages/modules.js:70406:24
	zone.js/</Zone$1</ZoneDelegate</ZoneDelegate.prototype.invokeTask http://localhost:3000/packages/modules.js:55873:17
	zone.js/</Zone$1</Zone</Zone.prototype.runTask http://localhost:3000/packages/modules.js:55641:28
	drainMicroTaskQueue http://localhost:3000/packages/modules.js:56048:25
	zone.js/</Zone$1</ZoneTask</ZoneTask.invokeTask http://localhost:3000/packages/modules.js:55953:21
	invokeTask http://localhost:3000/packages/modules.js:56970:9
	globalZoneAwareCallback http://localhost:3000/packages/modules.js:56996:17

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions