Skip to content

How to install @babel/runtime without completly breaking create-react-app #12318

@lemiesz

Description

@lemiesz

So I am using react-script: 5.0.0. However do to the way https://www.graphql-code-generator.com/ works, I need to directly install @babel/runtime as a dependency, else my plugins will fail to resolve.

However installing @babel/runtime seems to completly break react-scripts. Trying to build causes an error like this

Module not found: Error: Can't resolve '/local/home/**/Projects/**/src/**/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/createClass.js' in '/local/home/**/Projects/**/src/**/node_modules/pretty-format/build'

This there anything I can do to resolve this. The version of @babel/runtime im installing is "@babel/runtime": "7.17.9". However I have tried other versions including the exact version listed by cra

I will note that the dev sever actually runs fine... just when I try to build I get the above error

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions