Debug mode false breaks tree routes
# help-with-umbraco
a
So a strange one, my code works perfectly when debug is set to true, when it gets changes to false my custom routes stop working correctly and any api calls fail. Looking at the console network tab I can see the Html file is called for the section view but then nothing else loads. I'm registering files like this: https://github.com/UmbHost/UmbCheckout.Stripe/blob/20214b31970a480fa60907539706d44b5740ad44/Composers/RegisterFilesComposer.cs https://github.com/UmbHost/UmbCheckout.Stripe/blob/20214b31970a480fa60907539706d44b5740ad44/Files/UmbCheckoutStripeSettingsJsFIle.cs and routes like this: https://github.com/UmbHost/UmbCheckout.Stripe/blob/20214b31970a480fa60907539706d44b5740ad44/NotificationHandlers/StripeSettingsTreeNotificationHandler.cs When debug mode is true the page loads and works correctly, however when debug mode is false the page fails to load and falls back to the default dashboard page. Other pages load the views but then fail to be interactive, my thoughts are the resources file... But I'm not sure: https://github.com/UmbHost/UmbCheckout.Stripe/blob/20214b31970a480fa60907539706d44b5740ad44/wwwroot/UmbCheckout/js/umbcheckout.stripe.resources.js Any help would be greatly appreciated on this one!
j
Do you get this problem if you load the JS the "normal" way, using the package manifest?
I see you've got
BundleOptions = BundleOptions.None
in your package manifest. When you load assets directly via the
CustomBackOfficeAssetsCollectionBuilder
this wont (can't) be respected as the assets aren't tied to a specific package - so they get bundled by default. So, it could be that smidge (well, Nuglify) is upset with something in the JS that the browser is fine with.
a
I haven't tried, loading using the package manifest, although loading this way should be fine though?
That's my thought that it doesn't like something in the js, the fact that the view doesn't load at all for some and falls back to the default route is odd though isn't it? Again only when in Production mode.
Ok so I've moved the assets into the C# package manifest filter and it now runs in debug mode. Is there anyway to turn on logging for nuglify?
j
Sorry, I don't know. I turn it off for everything I do now as support for certain JS/CSS features has taken a while to make it into the libraries that smidge depends on. That has caused major headaches in the past. Coincidentally, a version of Vendr once failed to run in production because it used some (perfectly valid) CSS that smidge didn't like 😅
a
Ah ok, well I've moved the file references and it now works when not bundled So all good, thanks!
4 Views