You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I moved an old project that uses "react-contenful" to use Vite instead of Webpack.
On dev mode it runs OK but when building "react-contentful" it fails on the browser.
index.4dc67e6f.js:41 Uncaught ReferenceError: require is not defined
The problem is that it is using require in client side.
const { createClient } = require('contentful');
Might be that it needs an import instead?
Any idea what is the underlying issue here?
Thanks a lot!
The text was updated successfully, but these errors were encountered:
I moved an old project that uses "react-contenful" to use Vite instead of Webpack.
On dev mode it runs OK but when building "react-contentful" it fails on the browser.
index.4dc67e6f.js:41 Uncaught ReferenceError: require is not defined
The problem is that it is using require in client side.
const { createClient } = require('contentful');
Might be that it needs an import instead?
Any idea what is the underlying issue here?
Thanks a lot!
The text was updated successfully, but these errors were encountered: