splinetool / react-spline

React component for Spline scenes.
MIT License
1.19k stars 60 forks source link

Error: Cannot find module node_modules\next\image #203

Open stygian2a opened 3 months ago

stygian2a commented 3 months ago

Hi all !

Here is my code:

import Head from "next/head";
import Image from "next/image";
import { Inter } from "next/font/google";
import Spline from '@splinetool/react-spline/next';

export default function Home() {
  return (
    <>

      <main>
      <Spline
      scene="https://prod.spline.design/1aur52wdmMGqaFJr/scene.splinecode" 
    />
      </main>
    </>
  );
}

And I get:

Error: Cannot find module 'C:\Users\adrie\OneDrive\Documents\Unsolved\Amélia Davis\testspline\node_modules\next\image' imported from C:\Users\adrie\OneDrive\Documents\Unsolved\Amélia Davis\testspline\node_modules\@splinetool\react-spline\dist\react-spline-next.js
Did you mean to import "next/image.js"?

How can I fix that? Many thanks

stygian2a commented 3 months ago

It works if I change the code in node_modules\@splinetool\react-spline\dist\react-spline-next.js, but I guess I should not do that?

TheStarkster commented 3 months ago

@stygian2a any updates on this? im having the same problem, and yes changing directly into node modules won't be a good idea

kiloki-official commented 2 months ago

Same problem. It basically renders the package useless.

alabobriggs commented 2 weeks ago

Same issue here

kaceycleveland commented 2 weeks ago

Same here on Next 14.2.3