pmndrs / react-three-next

React Three Fiber, Threejs, Nextjs starter
https://react-three-next.vercel.app/
MIT License
2.52k stars 342 forks source link

Error when running styled-components template #129

Closed hatchli closed 1 year ago

hatchli commented 1 year ago

When performing clean install with styled-components, via yarn create r3f-app next test5 styled Installation goes fine (though regardless of whether -ts is provided or not, the following occurs:

> Success! Installed dependencies for styled-components 

> Initializing for styled-components... 

> Downgraded to @types/react@17.0.43 in order to fix styled-components (see DefinitelyTyped/issues/59765) 

On yarn run dev receive error:

wait  - compiling /_error (client and server)...
error - ./src/components/dom/Layout.jsx:2:0
Module not found: Empty dependency (no request)
  1 | 'use client'
> 2 | import {} from ''
  3 | 
  4 | import { useRef } from 'react'
  5 | import dynamic from 'next/dynamic'

Looking at the file, besides the aforementioned import {} from '', there is no difference between this file and the tailwind generated (default) version [which does work].

Deleting the failed import results in the project building, but not correctly and no assets loading and no styling being applied.

Following the solution provided at #125 only works if styled is omitted.

Node version v16.19.1, macOS 13.3.1

19Sean96 commented 1 year ago

experiencing the same issue.

RenaudRohlinger commented 1 year ago

Thanks for the report, latest version of create-r3f-app should fix this issue.

hatchli commented 1 year ago

Thanks for the report, latest version of create-r3f-app should fix this issue.

Of course! Unfortunately the latest version builds successfully following yarn run dev, but the output is not correct (see attached).

Screenshot 2023-05-08 at 11 34 42 AM