YacheLee / Aditor

A React component made by ProseMirror
https://yachelee.github.io/Aditor/
MIT License
9 stars 0 forks source link

./node_modules/aditor/dist/index.modern.js:4:0 Module not found: Can't resolve 'styled-components' null #2

Closed yelnyafacee closed 3 years ago

yelnyafacee commented 3 years ago

Failed to compile ./node_modules/aditor/dist/index.modern.js:4:0 Module not found: Can't resolve 'styled-components' null

YacheLee commented 3 years ago

Hi, sorry that I did not document that I used styled component as peer dependency. Solve this by npm install styled-components --save

yelnyafacee commented 3 years ago

I am getting this error now:

Server Error
Error: The id is required to use Aditor

This error happened while generating the page. Any console logs will be displayed in the terminal window.
Source
pages\_document.tsx (89:33) @ Function.getInitialProps

  87 |     }
  88 | 
> 89 |     const { html, head } = await ctx.renderPage({ enhanceApp })
     |                                 ^
  90 |     const styles = [...flush()]
  91 |     return { html, head, styles }
  92 |   }
YacheLee commented 3 years ago

Hi there, add the id to your Aditor.

<Aditor id="aditor" defaultValue={value} onChange={value=>{
  setValue(value);
}} />
YacheLee commented 3 years ago

We solved this already.