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.

[BUG] Can't import the named export 'Children' from non EcmaScript module (only default export is available)

See original GitHub issue

1. Read the FAQs šŸ‘‡

2. Describe the bug ./node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs Canā€™t import the named export ā€˜Childrenā€™ from non EcmaScript module (only default export is available)

Give a clear and concise description of what the bug is.

3. IMPORTANT: Provide a CodeSandbox reproduction of the bug

A CodeSandbox minimal reproduction will allow us to quickly follow the reproduction steps. Without one, this bug report wonā€™t be accepted.

4. Steps to reproduce Run npm install framer-motion import { motion } from ā€œframer-motionā€ run npm start Steps to reproduce the behavior:

  1. Go to ā€˜ā€¦ā€™
  2. Click on ā€˜ā€¦ā€™
  3. Scroll down to ā€˜ā€¦ā€™
  4. See error

5. Expected behavior

A clear and concise description of what you expected to happen.

6. Video or screenshots

If applicable, add a video or screenshots to help explain the bug.

7. Environment details

If applicable, let us know which OS, browser, browser version etc youā€™re using.

FAQs

Type error with AnimateSharedLayout

AnimateSharedLayout was deprecated in 5.0. Refer to the upgrade guide for instructions on how to remove.

Preact isnā€™t working

Framer Motion isnā€™t compatible with Preact.

AnimatePresence isnā€™t working

Have all of its immediate children got a unique key prop that remains the same for that component every render?

// Bad: The index could be given to a different component if the order of items changes
<AnimatePresence>
  {items.map((item, index) => <Component key={index} />)}
</AnimatePresence>
// Good: The item ID is unique to each component
<AnimatePresence>
  {items.map((item, index) => <Component key={item.id} />)}
</AnimatePresence>

Is the AnimatePresence correctly outside of the controlling conditional? AnimatePresence must be rendered whenever you expect an exit animation to run - it canā€™t do so if itā€™s unmounted!

// Bad: AnimatePresence is unmounted - exit animations won't run
{isVisible && (
  <AnimatePresence>
    <Component />
  </AnimatePresence>
)}
// Good: Only the children are unmounted - exit animations will run
<AnimatePresence>
  {isVisible && <Component />}
</AnimatePresence>

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:7
  • Comments:25

github_iconTop GitHub Comments

50reactions
Doughpcommented, Apr 26, 2022

Fixed this by changing import to " import {AnimatePresence, motion} from ā€œframer-motion/dist/framer-motionā€; "

18reactions
mortonicommented, Jun 10, 2022

When I use framer-motion/dist/framer-motion I get typescript errors ā€¦

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't import the named export 'Children' from non ...
Can't import the named export 'Children' from non EcmaScript module (only default export is available) [closed].
Read more >
can't import the named export 'children' from non ...
Can't import the named export 'Children' from non EcmaScript module (only default export is available) Give a clear and concise description of what...
Read more >
"Can't import the named export from non EcmaScript module ...
KJS: "Can't import the named export from non EcmaScript module (only default export is available)" with react-map-gl-draw external interface. Relates to 1.
Read more >
Can't import the named export from non EcmaScript module
ERROR in ../node_modules/@graphql-tools/mock/index.mjs 782:9-19 [1] Can't import the named export 'MapperKind' from non EcmaScript module (only default ...
Read more >
webpack/webpack - Gitter
Can't import the named export 'a' from non EcmaScript module (only default export is available) ERROR in ./node_modules/@ionic/core/dist/esm/loader.mjs 7:4-Ā ...
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