Skip to content
This repository has been archived by the owner on Jan 24, 2025. It is now read-only.

Can't import the named export 'Children' from non EcmaScript module #1686

Open
designbyadrian opened this issue Dec 17, 2021 · 2 comments
Open

Comments

@designbyadrian
Copy link

This is an issue with framer-motion running on certain setups including Create React App, NextJS, and Storybook.

The issue is more explained here: motiondivision/motion#1307, but I'd like to leave a report here because I think something needs to be adressed in this repo.

@Eric-Canas
Copy link

In Create React App 5 it is no longer an Issue. If you have a project created with a previous version just try to update react-scripts, it solved the problem for me.

npm install [email protected]

@prxg22
Copy link

prxg22 commented Feb 8, 2022

I was able to fix this by adding gatsby-node.js at the root of my project and the following rule on the webpack:

exports.onCreateWebpackConfig = ({ actions }) => {
  actions.setWebpackConfig({
    module: {
      rules: [
        {
          test: /\.mjs$/,
          include: /node_modules/,
          type: 'javascript/auto',
        },
      ],
    },
  })
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants