The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

505970 (10) [Avatar] Offline
#1
I'm following along with the book using typescript. after moving the files according to figure 2.19. I'm getting two error and those error messages are "Error [app-router] Error: Script error for "Aurelia-fetch-client", needed by: services/book-api" and "http 404: not found - the server has not found anything matching the requested URI (Uniform Resource Identifier). get - http://localhost:9000/src/aurelia-fetch-client.js'.

I have double checked all of the references and paths to all files and resources and cannot figure out why it cannot get to the resource.

Thanks,

I found that this error will be caused if Aurelia-fetch-client is not installed or not listed in the Aurelia.json. Thanks!
Sean Hunter (29) [Avatar] Offline
#2
Thanks for posting on the forum. Let me take a look at it and I'll get back to you.
Sean Hunter (29) [Avatar] Offline
#3
It looks like you're missing the Aurelia fetch client dependency. I'll have to review the instructions around this to make sure they are clear.

You can install this by stopping the Aurelia CLI run watch, and running the following commands:


au install aurelia-fetch-client
au run --watch



After running this command you should see the NPM package installed under the following path:

my-books\node_modules\aurelia-fetch-client


And, you should have the following entry in your aurelia.json file under the dependencies node:


    {
            "name": "aurelia-fetch-client",
            "main": "aurelia-fetch-client",
            "path": "../node_modules/aurelia-fetch-client/dist/amd",
            "resources": []
          }



You can cross check your aurelia.json file against this copy:

https://github.com/freshcutdevelopment/Aurelia-in-Action/blob/master/Chapter-2-Complete/my-books/aurelia_project/aurelia.json

Let me know how it goes smilie.

Cheers,
Sean
505970 (10) [Avatar] Offline
#4
Thanks installing the dependency corrected the issue.
Sean Hunter (29) [Avatar] Offline
#5
Ah that's great to hear. I'm glad that this resolved the issue.