josdejong / josdejong/jsoneditor

JEST: SyntaxError: Cannot use import statement outside a module

Open
#963 1 comment 0 reactions 0 assignees View on GitHub
invalid
Dominant language
JavaScript
Stars
12.3k
Forks
2.1k
PR merge metrics
No merged PRs in 30d

Description

We have an application that is build using create-react. On running tests, we're facing a syntax error related to jsoneditor-react. Please see below.
```
/Users/***/Documents/projects/***/node_modules/jsoneditor-react/es/index.js:1
({"Object.":function(module,exports,require,__dirname,__filename,global,jest){import React, { Component } from 'react';
^^^^^^

SyntaxError: Cannot use import statement outside a module

1 | import React from 'react'
2 | import styled from 'styled-components';
> 3 | import { JsonEditor as Editor } from 'jsoneditor-react';
```
Thanks.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.