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.

`chunkExtractor.getScriptElements` returns nested array in 5.13.1

See original GitHub issue

🐛 Bug Report

Public API for chunkExtractor.getScriptElements is described as being an Array of React <script> Elements. As of version 5.13.1 it returns an array who’s first element is also an array.

To Reproduce

Unfortunately I cannot share my private repo. But the recent change to this function was the cause of this error. https://github.com/gregberge/loadable-components/blob/8cf392d124100763921226bdfcac10d350b64b34/packages/server/src/ChunkExtractor.js#L300

Previously it returned a single element, but is now returning an array that isn’t getting spread in this function

https://github.com/gregberge/loadable-components/blob/8cf392d124100763921226bdfcac10d350b64b34/packages/server/src/ChunkExtractor.js#L384

Expected behavior

chunkExtractor.getScriptElements returns an array of react script elements.


Issue Analytics

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

github_iconTop GitHub Comments

0reactions
theKasheycommented, Jul 17, 2020

@markwoodward23 sounds like you need lerna bootstrap or yarn build made at the top level.

Read more comments on GitHub >

github_iconTop Results From Across the Web

loadable/server
ChunkExtractor. Used to collect chunks server-side and get them as script tags or script elements. Arguments, Description ...
Read more >
https://raw.githubusercontent.com/smooth-code/load...
... spread nested required chunks array ... [5.13.1](https://github.com/smooth-code/loadable-components/compare/v5.13.0...v5.13.1) (2020-07-02) ### Bug ...
Read more >
@loadable/babel-plugin: Versions | Openbase
... spread nested required chunks array(regression in 5.13.1) (95e6ecb) ... add load method that returns a Promise (#329) (a10a9d5), closes #226 ...
Read more >
When changed state of a multiple nested array of objects in ...
The issue I see is in setConfigure, below is the code you can give it a try const [tabValue, setTabValue] = useState(0); const...
Read more >
weixin_39756273的博客_CSDN博客-领域博主
2021-01-12. EKS Managed node groups autoscaling. 2021-01-12. `chunkExtractor.getScriptElements` returns nested array in 5.13.1. 2021-01-12 ...
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