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

Cannot render: worker-bundle.js:1 Uncaught SyntaxError: Unexpected token '<' #917

Open
freyja-934 opened this issue Mar 1, 2022 · 3 comments
Labels
bug important Requires inmediate attention
Milestone

Comments

@freyja-934
Copy link

freyja-934 commented Mar 1, 2022

I tried a bunch of different ways to do this and still get this same error.

import React from "react";
// Component
import Villain from "villain-react";
// Css styles
import "villain-react/dist/style.css";
export default function ComicReader() {
  let workerUrl = 'webworkers/worker-bundle.js';
  const url = "/assets/comics/test-comic-zip.zip";
  const opts = {
    theme: 'Dark',
    allowFullScreen: true,
    autoHideControls: false,
    allowGlobalShortcuts: true,
  };
  return (
    <div
      style={{
        width: "100%",
        margin: "0 auto",
        display: "block",
        paddingTop: "100px",
        backgroundColor: "#000000",
      }}
    >
      <Villain
        source={url}
        options={opts}
        workerUrl={workerUrl}
        className={'comic-viewer'}
      />
    </div>
  );
}

Screen Shot 2022-02-28 at 7 48 28 PM

@freyja-934 freyja-934 added the bug label Mar 1, 2022
@freyja-934
Copy link
Author

@btzr-io do you have a working example of this in a react app?

@btzr-io btzr-io pinned this issue Mar 1, 2022
@btzr-io
Copy link
Owner

btzr-io commented Mar 1, 2022

@btzr-io do you have a working example of this in a react app?

I'm not longer working on this project. I guess some dependencies are outdated or not longer work with this react component.

A full web-app example can be found here: ( Idk if this still works )
https://github.com/btzr-io/Villain/tree/master/packages/villain-web

Try the embed api. ( I'm not sure if this still works ), it should be easy to use an iframe instead:
https://villain.js.org/#/embed

@btzr-io btzr-io closed this as completed Aug 5, 2022
@btzr-io btzr-io added this to the v2.0.0 milestone Aug 5, 2022
@btzr-io btzr-io unpinned this issue Aug 13, 2022
@btzr-io btzr-io reopened this Aug 19, 2022
@btzr-io
Copy link
Owner

btzr-io commented Aug 19, 2022

This issue was resolved on the new version. I'll try to publish the new version in a few days / weeks.
I'm reopening this since this still exists in the current version.

@btzr-io btzr-io added the important Requires inmediate attention label Aug 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug important Requires inmediate attention
Projects
None yet
Development

No branches or pull requests

2 participants