Skip to content

SyntaxError: Unexpected token 'export' in jest #4971

@prachit07

Description

@prachit07

After updating to 2.8.0, we are facing the following issue in Jest unit testing

SyntaxError: Unexpected token 'export'. node_modules/@reduxjs/toolkit/dist/redux-toolkit.browser.mjs:1

Jest encountered an unexpected token

    Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax.

    Out of the box Jest supports Babel, which will be used to transform your files into valid JS based on your Babel configuration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions