javascript - How to remove sourceMappingURL from the angular universal build? - Stack Overflow

I'm using this repo as base. I have solved almost every other plugin's errors but I'm no

I'm using this repo as base. I have solved almost every other plugin's errors but I'm not able to solve this error.

No other plugin expects a .map file when making an SSR build as it is a production one. But I don't know from where is it creeping in.

Here is the line causing the error. in server.js file.

margin: -1px 0; }\n\n/*# sourceMappingURL=swiperponent.css.map

I don't want to remove it manually every time I make a build so how to solve the issue and what the issue could be.

ERROR Something went wrong please try again later! ERROR { Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'swiperponent.css.map' Error: Cannot match any routes. URL Segment: 'swiperponent.css.map' at ApplyRedirects.noMatchError (E:\xampp\htdocs\havemybooks\dist\server.js:146214:16) at CatchSubscriber.selector (E:\xampp\htdocs\havemybooks\dist\server.js:146195:29) at CatchSubscriber.error (E:\xampp\htdocs\havemybooks\dist\server.js:29486:31) at MapSubscriber.Subscriber._error (E:\xampp\htdocs\havemybooks\dist\server.js:20931:26)

Update:

I found the culprit it's the plugin which has inline /*# sourceMappingURL=swiperponent.css.map */ So is there a webpack configuration to replace the inline sourcemaps already present.

I tried --devtool false with webpack but no success

I'm using this repo as base. I have solved almost every other plugin's errors but I'm not able to solve this error.

No other plugin expects a .map file when making an SSR build as it is a production one. But I don't know from where is it creeping in.

Here is the line causing the error. in server.js file.

margin: -1px 0; }\n\n/*# sourceMappingURL=swiper.ponent.css.map

I don't want to remove it manually every time I make a build so how to solve the issue and what the issue could be.

ERROR Something went wrong please try again later! ERROR { Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'swiper.ponent.css.map' Error: Cannot match any routes. URL Segment: 'swiper.ponent.css.map' at ApplyRedirects.noMatchError (E:\xampp\htdocs\havemybooks\dist\server.js:146214:16) at CatchSubscriber.selector (E:\xampp\htdocs\havemybooks\dist\server.js:146195:29) at CatchSubscriber.error (E:\xampp\htdocs\havemybooks\dist\server.js:29486:31) at MapSubscriber.Subscriber._error (E:\xampp\htdocs\havemybooks\dist\server.js:20931:26)

Update:

I found the culprit it's the plugin which has inline /*# sourceMappingURL=swiper.ponent.css.map */ So is there a webpack configuration to replace the inline sourcemaps already present.

I tried --devtool false with webpack but no success

Share Improve this question edited Oct 2, 2018 at 16:52 Black Mamba asked Sep 28, 2018 at 16:20 Black MambaBlack Mamba 15.7k7 gold badges92 silver badges112 bronze badges 3
  • try removing \n\n (margin: -1px 0; }/*# sourceMappingURL=swiper.ponent.css.map) – Gaspar Commented Sep 28, 2018 at 16:32
  • Yes, that will fix the issue. But I don't want to do it manually every time I make a build. – Black Mamba Commented Sep 28, 2018 at 17:27
  • I think its that ponent for simplifying code and build with less space that put \n\n in this line. Try to look some configuration to that ponent (forget the name of it) – Gaspar Commented Sep 28, 2018 at 17:47
Add a ment  | 

1 Answer 1

Reset to default 8

This is a bug in angular cli. But you can manually specify to not to produce source maps in angular.json file.

"server": {
          "builder": "@angular-devkit/build-angular:server",
          "options": {
            ...
            "sourceMap": false
          },
         ...
 }

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744062557a4552045.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信