I am trying to load my GLTF model in Next.js app using @react-three/drei
but when loading my model I get this:
Server Error
Error: No “exports” main defined in /Users/primozrome/Documents/WEB/dewesoft-website/node_modules/@monogrid/gainmap-js/package.json
This error happened while generating the page. Any console logs will be displayed in the terminal window.
Ayone knows what is going on? Here is the code:
import { Canvas } from '@react-three/fiber';
import { Model } from '../../public/Obsidian';
const GeneralProductHeader = ({ title, subtitle, description, cover, icons, onOpen, height}) => {
const { t } = useTranslation();
const { asPath, locale } = useRouter();
const origin =
typeof window !== 'undefined' && window.location.origin
? window.location.origin
: '';
const url = `${origin}${asPath}`;
const openDrawer = () => {
va.track('QUOTATION DRAWER', {
trigger: 'PRODUCT HEADER',
product: title,
url: url,
locale: locale
});
onOpen();
}
return (
<Flex>
<Canvas>
<Model />
</Canvas>
</Flex>
)
}
If I remove the Model
import, the error is gone!