You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to test for component use aliplayer-react, an error triggered in aliplayer-react/lib/index.js indicates that ES6 syntax import used outside the module.
● Test suite failed to run
.../node_modules/aliplayer-react/lib/index.js:12
import React, { useEffect, useRef, useMemo } from 'react';
^^^^^^
SyntaxError: Cannot use import statement outside a module
1 | import React, { Component } from 'react'
> 2 | import Player from "aliplayer-react";
| ^
3 | import './index.less';
4 |
5 | export default class AliyunPlayer extends Component {
at ScriptTransformer._transformAndBuildScript (node_modules/@jest/transform/build/ScriptTransformer.js:537:17)
at ScriptTransformer.transform (node_modules/@jest/transform/build/ScriptTransformer.js:579:25)
at Object.<anonymous> (src/components/AliyunPlayer/index.jsx:2:1)
I believe that Jest is a Node environment and ES6 syntax is still an experimental feature in Node.
The text was updated successfully, but these errors were encountered:
When trying to test for component use aliplayer-react, an error triggered in
aliplayer-react/lib/index.js
indicates that ES6 syntaximport
used outside the module.I believe that Jest is a Node environment and ES6 syntax is still an experimental feature in Node.
The text was updated successfully, but these errors were encountered: