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

failed to build with docusaurus@latest #14

Closed
Ad-Bean opened this issue Mar 22, 2023 · 2 comments
Closed

failed to build with docusaurus@latest #14

Ad-Bean opened this issue Mar 22, 2023 · 2 comments

Comments

@Ad-Bean
Copy link

Ad-Bean commented Mar 22, 2023

  "dependencies": {
    "@docusaurus/core": "2.3.1",
    "@docusaurus/preset-classic": "2.3.1",
    "@emotion/react": "^11.10.6",
    "@emotion/styled": "^11.10.6",
    "@mdx-js/react": "^1.6.22",
    "@mui/icons-material": "^5.11.11",
    "@mui/lab": "5.0.0-alpha.123",
    "@mui/material": "^5.11.13",
    "clsx": "^1.2.1",
    "prism-react-renderer": "^1.3.5",
    "react": "^18.2.0",
    "react-declarative": "^2.2.115",
    "react-dom": "^18.2.0",
    "tss-react": "^4.8.2",
    "xlsx": "^0.18.5"
  },

when I tried to use react-declarative with docusaurus@latest, it failed to run pnpm build and got the following errors:

image

@tripolskypetr
Copy link
Member

I have upgraded ESBuild. Maybe It will fix that issue...

image

If this not going to help, try to remove index.modern.js.

image

The docusaurus is working with CommonJS modules only so It should make a fallback

image

If still not Ok, try to wrap you react-declarative widgets to web-components and load them from custom library. Write an issue in ESBuild repository

import { createWebComponent, One } from 'react-declarative';

createWebComponent("frontend-widget", (params) => (
    <One
      ...
    />
));

...

<frontend-widget />

@tripolskypetr
Copy link
Member

See facebook/docusaurus#6520.

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

2 participants