question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

See original GitHub issue

Current behavior

image

To reproduce

git clone https://github.com/mesqueeb/planetar
git checkout vue-docgen-api-parse
cd api-card/ui
npm i
cd dev
npm i && cd ../
npm run dev

Expected behavior

No error 😄

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mesqueebcommented, May 4, 2020

@elevatebart feel free to close this issue and document that loader you made for this use-case! 😉

0reactions
elevatebartcommented, Jul 30, 2020

@fernandopasik It is a great idea. Would you be OK with making a PR?

To answer your question, vue-simple-docgen-loader is meant to be used as follows:

const docobject = require('vue-simple-docgen-loader!./component.vue')
console.log(docobject)

The code above will print the object generated by vue-docgen-api without modifications. You can find the specifications for this object here and a full example here @pocka 's loader soes some modification to the object to adapt it to the storybook datamodel.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Critical dependency: require function is used in a way ...
Critical dependency : require function is used in a way in which dependencies cannot be statically extracted · Subscribe to RSS.
Read more >
Critical dependency: require function is used in a way ...
The error originates from the esm target, which should not have any require statements. It'd be nice to explore that built module and...
Read more >
Incompatible with Webpack
"require function is used in a way, in which dependencies cannot be statically extracted" These errors come when trying to "require" specific modules, ......
Read more >
Critical dependency: require function is used in a way ...
Critical dependency : require function is used in a way in which dependencies cannot be statically extracted ; samueljbarrick May 4, 2020, 10:28pm ......
Read more >
WARNING in Critical dependency: require function is used ...
Node.js – WARNING in Critical dependency: require function is used in a way in which dependencies cannot be statically extracted · Best Solution...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found