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

Error when building wikijs with Vite: Cannot acces stream.Transfrom in client code #175

Open
powerslave opened this issue Apr 25, 2023 · 0 comments

Comments

@powerslave
Copy link

I am running into a browser error when trying to execute the basic wikijs sample snippet:
The project builds with Vite 3.2.3.

Is there a build option needed for Vite, similar to Usage with Webpacl?

Browser error:

stream-tokenizer.js:5 Uncaught TypeError: Class extends value undefined is not a constructor or null
    at node_modules/hyntax/lib/stream-tokenizer.js (stream-tokenizer.js:5:1)
    at __require (chunk-TWLJ45QX.js?v=8133fa8e:8:50)
    at node_modules/hyntax/index.js (index.js:3:25)
    at __require (chunk-TWLJ45QX.js?v=8133fa8e:8:50)
    at page.js:2:41

There is also a (related?) warning above this error.
browser-external:stream:9 Module "stream" has been externalized for browser compatibility. Cannot access "stream.Transform" in client code.

code:

import wiki from "wikijs";

    wiki()
      .page("Batman")
      .then((page) => page.info("alterEgo"))
      .then(console.log); // Bruce Wayne

package.json config

"wikijs": "^6.4.1"
"vite": "^3.2.3"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant