I have a html file in the
src/utils directory
and tried importing this file in a collection, but was unable to because it says cannot find the module.Please help me with this.
HTML files cannot be imported as modules, only Javascript/Typescript. You would need to export your HTML code as a string within a JS or TS file:
// yourHtmlFile.js
export default html = `<html>...</html>`
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.