Fix fs import errod

This commit is contained in:
Sam Carlton 2021-04-27 17:01:46 -05:00
parent 9e26670d63
commit bc7a5de462

View file

@ -122,11 +122,8 @@ export default {
// Manually get payload as fallback // Manually get payload as fallback
if ( payload === undefined ) { if ( payload === undefined ) {
const { promises: fs } = await import('fs')
// Read back the JSON we just wrote to ensure it exists // Read back the JSON we just wrote to ensure it exists
const savedListJSON = await fs.readFile('./static/nuxt-endpoints.json', 'utf-8') const { default: savedList } = await import('~/static/nuxt-endpoints.json')
const savedList = JSON.parse( savedListJSON )
const endpoint = savedList.find( resource => { const endpoint = savedList.find( resource => {
return resource.route === route.path return resource.route === route.path