[ReactFreezeframe] Jest import issue - Cannot use import statement outside a module
Closed this issue · 5 comments
steoo commented
While running jest tests are failing because of this error, does anyone has the same issue?
SyntaxError: Cannot use import statement outside a module
1 | import React, { Component, Fragment } from 'react';
> 2 | import ReactFreezeframe from 'react-freezeframe';
| ^
3 | import PropTypes from 'prop-types';
4 | import classnames from 'classnames';
nickforddev commented
gerhat commented
Actually I get SyntaxError: Unexpected identifier
for the same line.
sarahbilly commented
I also had this issue, but adding this to my package.json in the jest
settings worked:
"transformIgnorePatterns": [
"<rootDir>/node_modules/(?!(freezeframe|react-freezeframe))"
]
nickforddev commented
this is just a matter of properly configuring your jest config, closing