michelson / dante2

A complete rewrite of dante editor in draft-js
https://michelson.github.io/dante2/
Other
912 stars 121 forks source link

Could not find declaration file for Dante2 #206

Closed harshchau closed 4 years ago

harshchau commented 4 years ago

I am build a next.js app and planning to embed Dante2. My import for Dante2 shows the following error

image Despite the error, the editor seems to be working fine.

I used npm install --save Dante2@next to install and my JS source looks like

import Layout from '../components/MyLayout';
import Dante from "Dante2"

export default function Editor() {
    return (
      <div>
        <Layout>

        <Dante onChange={editor => { console.log('editor content: ', editor.emitSerializedOutput()) }}/>

        </Layout>
      </div>
    );
  }
michelson commented 4 years ago

That error shows at compile too?

El sáb., 22 de febrero de 2020 5:55 p. m., dashersch < notifications@github.com> escribió:

I am build a next.js app and planning to embed Dante2. My import for Dante2 shows the following error

[image: image] https://user-images.githubusercontent.com/3878472/75099068-60bc7500-558b-11ea-93df-ec86601de46c.png Despite the error, the editor seems to be working fine.

I used npm install --save Dante2@next to install and my JS source looks like

import Layout from '../components/MyLayout';import Dante from "Dante2" export default function Editor() { return (

{ console.log('editor content: ', editor.emitSerializedOutput()) }}/>
);

}

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/michelson/dante2/issues/206?email_source=notifications&email_token=AAAC5SAI4GASGFJHHWBOTYTREGGMTA5CNFSM4KZURJX2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IPQHPZA, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAC5SFZIFWRCBEU3QXNJADREGGMTANCNFSM4KZURJXQ .

harshchau commented 4 years ago

The compile message for npm run dev is successful.

But my build npm run build does show the following error although nothing points to Dante2

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   '/usr/local/Cellar/node/13.8.0/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'run',
1 verbose cli   'build'
1 verbose cli ]
2 info using npm@6.13.7
3 info using node@v13.8.0
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle active-md@1.0.0~prebuild: active-md@1.0.0
6 info lifecycle active-md@1.0.0~build: active-md@1.0.0
7 verbose lifecycle active-md@1.0.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle active-md@1.0.0~build: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/harsh/git/active-md/node_modules/.bin:/Library/Frameworks/Python.framework/Versions/3.7/bin:/anaconda3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Frameworks/Python.framework/Versions/3.7/bin:/anaconda3/bin
9 verbose lifecycle active-md@1.0.0~build: CWD: /Users/harsh/git/active-md
10 silly lifecycle active-md@1.0.0~build: Args: [ '-c', 'next build' ]
11 silly lifecycle active-md@1.0.0~build: Returned: code: 1  signal: null
12 info lifecycle active-md@1.0.0~build: Failed to exec build script
13 verbose stack Error: active-md@1.0.0 build: `next build`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:321:20)
13 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:321:20)
13 verbose stack     at maybeClose (internal/child_process.js:1026:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid active-md@1.0.0
15 verbose cwd /Users/harsh/git/active-md
16 verbose Darwin 19.3.0
17 verbose argv "/usr/local/Cellar/node/13.8.0/bin/node" "/usr/local/bin/npm" "run" "build"
18 verbose node v13.8.0
19 verbose npm  v6.13.7
20 error code ELIFECYCLE
21 error errno 1
22 error active-md@1.0.0 build: `next build`
22 error Exit status 1
23 error Failed at the active-md@1.0.0 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
michelson commented 4 years ago

hard to tell then. if you remove Dante imports will compile ?

mbm-michal commented 4 years ago

@dashersch my recommendation is to use different node version. Try https://github.com/nvm-sh/nvm to switch between different version. I've used v10.17.0 and no issue, maybe v12 will work with your code not sure though.. Had quite few roadblocks when using v13 on my end.

michelson commented 4 years ago

Hi @mbm-michal , thanks for your intervention, did you make work dante with next? I would love to make a documentation page on that. But I've never worked on next

mbm-michal commented 4 years ago

@michelson no I have not but I based on @dashersch logs I saw node@v13.8.0 and it's pretty new version. I've tried quite few node version and in my case and my code v10.17.0 works correctly. That's why I just recommend trying different version.

harshchau commented 4 years ago

I will try to go to node. v12 to see if that clears up the errors. As I mentioned in #207 , after installing prism, I am gettinga. clean build with node v13 image

BTW @michelson I have Dante2 working with a basic Next app

michelson commented 4 years ago

oh , that's great!

should we close this then ?

harshchau commented 4 years ago

Done