#Issue when deploying web in Netlify

1 messages · Page 1 of 1 (latest)

calm yew
#

Hello, I am trying to deploy my final module solo project in Netlify and I'm getting the attached error. Can anyone who has encountered a similar error and has been able to solve it help me?

I was getting a different error before, https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated, and I tried renaming the vite.config.js file to vite.config.mjs as recommended on the page, but it still doesn't work.

Thank you in advance for your help!

Next Generation Frontend Tooling

#

Issue when deploying web in Netlify

timid glacier
timid glacier
#

@calm yew in case you are not around:
I had the same issue, all you need is to add this to your package.json file:
"type": "module", on the top (photo included), then you don't need to change any files to mjs or anything else and the error should go away.

calm yew
#

@timid glacier thank you for your help! I tried to make changes in my json file as you mentioned and it didn't help. Please see attached my file in case you could take a look. Thank you!

#

Thank you!

timid glacier
#

@calm yew - I think the issue is with your project folder structure, can you share a screenshot of it?

#

I think the prblem is either inside your css file or your folder structure.

#

CssSyntaxError: [vite:css] [postcss] /opt/build/repo/styles.css:23:1: Unexpected }

it looks like you have an extra } somewhere in the CSS?