I can't start project with Vite and daisyui

I can’t start the a project with vite (cra) and daisyui (tailwindcss), i have the next error:

Aug 30 11:10:23 AM ✓ built in 1.48s
Aug 30 11:10:23 AM [vite:css] [postcss] Object.hasOwn is not a function
Aug 30 11:10:23 AM file: /opt/render/project/src/src/index.css:undefined:undefined
Aug 30 11:10:23 AM error during build:
Aug 30 11:10:23 AM TypeError: [postcss] Object.hasOwn is not a function
Aug 30 11:10:23 AM at /opt/render/project/src/node_modules/daisyui/src/theming/functions.js:73:19
Aug 30 11:10:23 AM at Array.forEach ()
Aug 30 11:10:23 AM at Object.convertColorFormat (/opt/render/project/src/node_modules/daisyui/src/theming/functions.js:44:27)
Aug 30 11:10:23 AM at /opt/render/project/src/node_modules/daisyui/src/theming/functions.js:187:41
Aug 30 11:10:23 AM at Array.forEach ()
Aug 30 11:10:23 AM at Object.injectThemes (/opt/render/project/src/node_modules/daisyui/src/theming/functions.js:182:28)
Aug 30 11:10:23 AM at mainFunction (/opt/render/project/src/node_modules/daisyui/src/index.js:68:43)
Aug 30 11:10:23 AM at registerPlugins (/opt/render/project/src/node_modules/tailwindcss/lib/lib/setupContextUtils.js:794:61)
Aug 30 11:10:23 AM at createContext (/opt/render/project/src/node_modules/tailwindcss/lib/lib/setupContextUtils.js:1196:5)
Aug 30 11:10:23 AM at getContext (/opt/render/project/src/node_modules/tailwindcss/lib/lib/setupContextUtils.js:1253:19)
Aug 30 11:10:23 AM npm ERR! code ELIFECYCLE
Aug 30 11:10:23 AM npm ERR! errno 1
Aug 30 11:10:23 AM npm ERR! thaba-intranet@0.0.0 build: tsc && vite build

Hi there,

Try updating the NodeJS version ( Specifying a Node Version | Render ), I don’t think Object.hasOwn exists in NodeJS 14, which is Render’s default version. You should use the same NodeJS version on Render as you use locally or are testing with.

Regards,

Keith
Render Support, UTC+10 :australia:

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.