I am trying to access a css file present at root .next directory
with below code
const criticalCSSPath = path.join(process.cwd(), ‘functions’, ‘optiBootstrap.css’);
const criticalCSS = fs.readFileSync(criticalCSSPath, ‘utf8’);
but I am getting below error
Jul 5, 01:27:56 AM: 13a2d169 INFO render >> RootLayoutJul 5, 01:27:56 AM: 13a2d169 ERROR Error: ENOENT: no such file or directory, open ‘/var/task/functions/optiBootstrap.css’
at Object.openSync (node:fs:596:3)
at Object.readFileSync (node:fs:464:35)
at RootLayout (/var/task/.next/server/chunks/9770.js:1:3295) {
errno: -2,
syscall: ‘open’,
code: ‘ENOENT’,
path: ‘/var/task/functions/optiBootstrap.css’
}
I see error is in netlify SSR function - https://dev.1millionresume.com/.netlify/functions/___netlify-handler
Can netlify team guide me on this?