[go: nahoru, domu]

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

[BUG] Can't build custom components with react-docgen 7 #2874

Open
daviddavo opened this issue Jun 4, 2024 · 0 comments
Open

[BUG] Can't build custom components with react-docgen 7 #2874

daviddavo opened this issue Jun 4, 2024 · 0 comments

Comments

@daviddavo
Copy link

Describe your context

Please provide us your environment, so we can easily reproduce the issue.

  • replace the result of pip list | grep dash below
dash                      2.17.0
dash-bootstrap-components 1.6.0
dash-core-components      2.0.0
dash-html-components      2.0.0
dash-table                5.0.0
dash-testing-stub         0.0.2
  • if frontend related, tell us your Browser, Version and OS

    • OS: [e.g. iOS]
    • Browser [e.g. chrome, safari]
    • Version [e.g. 22]

Describe the bug

I developed a library with some custom components. I'm trying to update some dependencies, and it turns out that I can't update react-docgen because of dash's extract-meta.js, which uses a deprecated require()
A clear and concise description of what the bug is.

$  npm run build

> dao-analyzer-components@0.0.23 build
> npm run build:js && npm run build:backends


> dao-analyzer-components@0.0.23 build:js
> webpack --mode production

asset dao_analyzer_components.min.js 13.4 KiB [emitted] [compared for emit] [minimized] (name: main) 1 related asset
orphan modules 21.9 KiB [orphan] 6 modules
runtime modules 2.42 KiB 5 modules
./src/lib/index.js + 6 modules 22.2 KiB [not cacheable] [built] [code generated]
webpack 5.91.0 compiled successfully in 1287 ms

> dao-analyzer-components@0.0.23 build:backends
> dash-generate-components ./src/lib/components dao_analyzer_components -p package-info.json --ignore \.test\.

/home/davo/Documents/GRASIA/dao-analyzer/.direnv/python-3.12/lib/python3.12/site-packages/dash/extract-meta.js:15
const reactDocs = require('react-docgen');
                  ^

Error [ERR_REQUIRE_ESM]: require() of ES Module /home/davo/Documents/GRASIA/dao-analyzer/dao_analyzer_components/node_modules/react-docgen/dist/main.js from /home/davo/Documents/GRASIA/dao-analyzer/.direnv/python-3.12/lib/python3.12/site-packages/dash/extract-meta.js not supported.
Instead change the require of main.js in /home/davo/Documents/GRASIA/dao-analyzer/.direnv/python-3.12/lib/python3.12/site-packages/dash/extract-meta.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (/home/davo/Documents/GRASIA/dao-analyzer/.direnv/python-3.12/lib/python3.12/site-packages/dash/extract-meta.js:15:19) {
  code: 'ERR_REQUIRE_ESM'
}

Node.js v22.2.0

Error generating metadata in dao_analyzer_components (status=1)

Expected behavior

To be able to build my library

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