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
-
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
1 Answer
Reset to default 8This 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
},
...
}