Skip to content

Commit

Permalink
Merge pull request #666 from dpc-sdp/chore/layer-cleanup
Browse files Browse the repository at this point in the history
fix(nuxt-ripple): fixed console errors appearing for static assets
  • Loading branch information
dylankelly authored Jun 21, 2023
2 parents 6d6e850 + b48695b commit 4968f2d
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions packages/nuxt-ripple/pages/[...slug].vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,33 @@ export default {
name: 'TideWrapper'
}
</script>

<script setup>
import { definePageMeta } from '#imports'
// After upgrading to nuxt 3.5.2, we were seeing alot of console errors
// When fetching assets from the /public folder, this route was getting hit too.
// This is only an issue if the /public folder is inside a layer
//
// TODO This should be revisited as it is likely a bug in Nuxt
definePageMeta({
validate: async (route) => {
const assetsPaths = [
'/assets/',
'/img/',
'/android-chrome-192x192.png',
'/android-chrome-512x512.png',
'/apple-touch-icon.png',
'/browserconfig.xml',
'/favicon-16x16.png',
'/favicon-32x32.png',
'/favicon.ico',
'/mstile-150x150.png',
'/safari-pinned-tab.svg',
'/site.webmanifest'
]
return !assetsPaths.some((substr) => route.fullPath.startsWith(substr))
}
})
</script>

0 comments on commit 4968f2d

Please sign in to comment.