preboot / angular-webpack

A complete, yet simple, starter for Angular v2+ using webpack
MIT License
1.29k stars 556 forks source link

404 when trying to http a json #326

Open phil123456 opened 7 years ago

phil123456 commented 7 years ago

Hi,

my former code allowed me to http a json but now I use this seed, I get 404's

I am not sure if it is a webpack issue or something

this.http.get('app/translations/en.json') does not work anymore

any hint/help ?

thanks

phil123456 commented 7 years ago

stupid of me, I have put things in "public" folder, now it's working

maxx0r commented 7 years ago

tried leaving out app/?

On Thu, Mar 30, 2017 at 2:37 PM, phil123456 notifications@github.com wrote:

Hi,

my former code allowed me to http a json but now I use this seed, I get 404's

I am not sure if it is a webpack issue or something

this.http.get('app/translations/en.json') does not work anymore

any hint/help ?

thanks

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/preboot/angular-webpack/issues/326, or mute the thread https://github.com/notifications/unsubscribe-auth/ACWx9lzSoLZBAk1yz25JXQBhVCqFmzE-ks5rq6IigaJpZM4MuTB1 .

phil123456 commented 7 years ago

yes I did that too

but I try to debug it and I cant see the ts files in chrome, I cant open any files, wonder if the .map files went through

phil123456 commented 7 years ago

adding # did the trick...(I think) it's an issue with that version of webpack https://github.com/webpack/webpack/issues/2145 (not sure since I am a complete angular noob)

 if (isProd) {
    config.devtool = '#source-map';
  }
  else if (isTest) {
    config.devtool = '#inline-source-map';
  }
  else {
    config.devtool = '#eval-source-map';
  }

[edit: just checked without the # and I can see the sources, wtf...]