Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't resolve 'reakit' #739

Closed
Daniil-Solovyev opened this issue Nov 29, 2020 · 5 comments
Closed

Can't resolve 'reakit' #739

Daniil-Solovyev opened this issue Nov 29, 2020 · 5 comments
Labels

Comments

@Daniil-Solovyev
Copy link

Hello!
I am getting an error when running this script. Did anyone have the same problem? What am I doing wrong?

./node_modules/villain-react/dist/villain.js
Module not found: Can't resolve 'reakit' in '...reader\node_modules\villain-react\dist'

import React from "react"
import Villain from "villain-react"

import 'villain-react/dist/style.css'

const Reader = () => {
    const url = '~/archives/archive_5247_115849.cbr'
    const workerUrl="./libarchive.js/dist/worker-bundle.js"

    return <Villain source={url} workerUrl={workerUrl} />
}

export default Reader
@btzr-io
Copy link
Owner

btzr-io commented Nov 29, 2020

@Daniil-Solovyev You need to include reakit as a dependency in your project. Is not included in build.
https://reakit.io/

@btzr-io
Copy link
Owner

btzr-io commented Nov 29, 2020

I was working on version 2.0 ( It allows you to create a custom UI and some other improvements ) see: #634

But I'm not sure if this module is used enough to keep maintaining it.
Please let me know if you are interested on v-2.0.

@Daniil-Solovyev
Copy link
Author

Daniil-Solovyev commented Nov 30, 2020

I include reakit.
Now my code is

import React from "react"
import Villain from "villain-react"

import 'villain-react/dist/style.css'

const Reader = () => {
    const url = '~/archives/archive_5247_115849.cbr'
    const workerUrl="~/node_modules/libarchive.js/dist/worker-bundle.js"

    return (
        <Villain source={url} workerUrl={workerUrl}/>
    )
}

export default Reader

And error

Безымянный

@btzr-io
Copy link
Owner

btzr-io commented Nov 30, 2020

This files are going to be accessed by the browser so it needs to be an absolute path:

Try to move this files to the public or static files directory in your server ( Usually where index.html is located )

Something like this

const url = 'http://localhost:3001/static/archives/archive_5247_115849.cbr'
const workerUrl="http://localhost:3001/static/js/worker-bundle.js"

Alternative: you can use an iframe to embed the reader.
See: https://villain.js.org/#/embed

@Daniil-Solovyev
Copy link
Author

Ok. Than you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants