Skip to content
This repository was archived by the owner on May 15, 2022. It is now read-only.

NextJS Server Error  #61

@robksawyer

Description

@robksawyer

I'm getting the following error when running this in NextJS. I'm using the following config.

Server Error
Error: No "exports" main resolved in /Users/.../node_modules/react-dat-gui/package.json
This error happened while generating the page. Any console logs will be displayed in the terminal window.
const Controls = () => {
  const state = {
    data: {
      package: 'react-dat-gui',
      cameraRotationX: 0.6,
    },
  }

  const [data, setData] = useState(state)

  // Update current state with changes from controls
  const handleUpdate = (newData) => {
    console.log('newData', newData)
    setData((prevState) => ({
      data: { ...prevState.data, ...newData },
    }))
  }

  console.log('data', data)

  return (
    <DatGui
      data={data}
      onUpdate={handleUpdate}
      className="react-dat-gui-relative-position"
    >
      <DatNumber
        path="cameraRotationX"
        label="Number"
        min={-100}
        max={100}
        step={0.1}
      />
    </DatGui>
  )
}

And then in my main React component, just calling <Controls />.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions