This repository was archived by the owner on Jan 26, 2019. It is now read-only.
This repository was archived by the owner on Jan 26, 2019. It is now read-only.
.mjs files in node_modules break jest #287
Closed
Description
Is this a bug report?
Yes
Can you also reproduce the problem with npm 4.x?
Yes
Environment
All environments
Steps to Reproduce
-
yarn add graphql@0.13.2 @types/graphql
-
Add the following code to App.tsx:
import { graphql } from 'graphql' console.log(graphql)
-
yarn test -t 'renders without crashing'
Expected Behavior
Test should pass
Actual Behavior
FAIL src/App.test.tsx
● Test suite failed to run
/Users/mbrowne/_temp/test-app/node_modules/graphql/index.mjs:2
export { graphql, graphqlSync } from './graphql';
^^^^^^
SyntaxError: Unexpected token export
Solution
This is a known bug in create-react-app. The fix should be simple: simply merge this PR into this repo (it was already merged into the official create-react-app).
Metadata
Metadata
Assignees
Labels
No labels