Meteor 1.8 can not import html files in typescript code

Hi all,
I just upgraded my project from meteor version 1.6 .0.1 to 1.8. It upgraded automatically to version 1.8.0.2.
I use typescript, although I also have lots of js files as well.
I use angularjs (version 1) in my project and do lots of html imports. This worked fine in previous version, but in 1.8 version, when I tried to run the project it failed in chrome console, when trying to import an html file:

import './infoRamo/editarInfoRamoModal.html';

The error message in the chrome console is:

Uncaught Error: Cannot find module ‘./infoRamo/editarInfoRamoModal.html’

As I said, this worked perfectly when my project was in meteor version 1.6.

I also must say that the upgrading process upgraded barbutus:typescript from version 0.9.12 to 0.70. In my desperation, I reversed that upgrade and returned to version 0.9.12 to that package, but everything remained the same.

Some help here would be appreciated.
Thanks and bye …

Looks like your Angular templates package is not added. I remember a similar issue with Blaze when we upgraded.

Try:

meteor remove angular-templates
meteor add angular-templates

Hi Illustreets,
Thanks for your answer. Apparently, angular-templates was there. The error is still there:

1) after issuing: meteor remove angular-templates

Changes to your project’s package version selections:
angular-templates removed from your project
angular-templates-runtime removed from your project
angular-templates: removed dependency

2) then doing: meteor add angular-templates

Changes to your project’s package version selections:
angular-templates added, version 1.0.3
angular-templates-runtime added, version 0.0.1
angular-templates: Compile angular templates into the template cache

I changed the file from .ts to .js. The import fails the same. So, at least we know it is not a typescript issue.

But, what could it be? …

I think, definitely, angular-templates package is what is causing this issue. When upgraded to meteor 1.8, it seems the version of this package went from:

angular-templates@1.0.9 to
angular-templates@1.0.3 (a previous version than before?)

Nevertheless, when I removed that version and tried to install version 1.0.9, I got:

meteor add angular-templates@=1.0.9
=> Errors while adding packages:

While selecting package versions:
error: Conflict: Constraint urigo:static-html-compiler@0.1.8 is not satisfied by urigo:static-html-compiler 0.0.5.
Constraints on package “urigo:static-html-compiler”:

  • urigo:static-html-compiler@0.1.8 <- angular-templates 1.0.9

So I’m just thinking about how to resolve that issue. Any ideas? …

You have an older version of urigo:static-html-compiler. Maybe try this first:

meteor remove urigo:static-html-compiler
meteor add urigo:static-html-compiler@=0.1.8

Hi illustreets, many thanks for all your help, it’s really much appreciated.

I think I’m in a dependency hell situation right now. When I try to install urigo:static-html-compiler, I get:

C:\scrwebm_v5>meteor add urigo:static-html-compiler@0.1.8
=> Errors while adding packages:
While selecting package versions:
error: Conflict: Constraint babel-compiler@6.8.0 is not satisfied by babel-compiler 7.2.4.
Constraints on package “babel-compiler”:

  • babel-compiler@~7.2.4 <- top level
  • babel-compiler@7.2.0 <- ecmascript 0.12.4
  • babel-compiler@7.2.0 <- standard-minifier-js 2.4.0
  • babel-compiler@7.2.0 <- minifier-js 2.4.0 <- standard-minifier-js 2.4.0
  • babel-compiler@6.8.0 <- urigo:static-html-compiler 0.1.8

What I can understand is that urigo:static-html-compiler@0.1.8 wants version 6.8.0 of babel-compiler, but version 7.2.4. is currently installed.

Do you think I should issue an:

meteor add urigo:static-html-compiler@=0.1.8 --allow-incompatible-update

and then an:

meteor add angular-templates@=1.0.9 --allow-incompatible-update.

It seems there is not a more recent version for angular-templates than 1.0.9, which is the source of all this problem.

Many thanks and bye …

Well, now I’m just very confused. I did an:

meteor add urigo:static-html-compiler@=0.1.8 –allow-incompatible-update, just to force that version of the package, whatever conflicting constraints it could have, but it failed exactly with the same error as before (???):

C:\scrwebm_v5>meteor add urigo:static-html-compiler@=0.1.8 --allow-incompatible-update
=> Errors while adding packages:

While selecting package versions:
error: Conflict: Constraint babel-compiler@6.8.0 is not satisfied by babel-compiler 7.2.4.
Constraints on package “babel-compiler”:

  • babel-compiler@~7.2.4 <- top level
  • babel-compiler@7.2.0 <- ecmascript 0.12.4
  • babel-compiler@7.2.0 <- standard-minifier-js 2.4.0
  • babel-compiler@7.2.0 <- minifier-js 2.4.0 <- standard-minifier-js 2.4.0
  • babel-compiler@6.8.0 <- urigo:static-html-compiler 0.1.8

I thought that, by including –allow-incompatible-update, I could force the installation of the package, independent of the version of other packages that it has a relation with, namely babel-compiler, which is of version 7.2.4, but a version 6.8.0 is expected.

Evidently I’m doing something wrong here. What could it be?

Thanks and bye …

Sometimes removing all the saved version numbers from .meteor/versions can help in situations like this. just delete all the content from that file and see if it helps.

Otherwise you might need to do a meteor update --packages-only --all-packages --allow-incompatible-update and deal with any of the bugs that might rear their heads