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
{{ message }}
This repository has been archived by the owner on Jan 31, 2021. It is now read-only.
I encountered the same error that we saw on the sandbox again. This time when running a Jest test that shallow renders my main <App /> component using Enzyme:
It seems to be triggered by using import { useRouter } from 'react-router-ts';, since this line is pointed out in the error message. That's also about when we saw the error on the sandbox too, after it was updated to use that.
/node_modules/react-router-ts/dist/index.js:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest)
{export * from "./basename";
^^^^^^
SyntaxError: Unexpected token 'export'
>
> 19 | import { useRouter } from 'react-router-ts';
>
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/App.jsx:19:1)
Possibly an issue with the build script not compiling the ./basename file?
Interestingly, my app runs fine. Only my tests causes the error.
The text was updated successfully, but these errors were encountered:
Thanks for the info. Hopefully Jest gets this updated eventually. I experimented with the suggestion & others, but it gets more complicated once other layers like create-react-app and react-app-rewired are involved, given both alter Babel and Jest behavior. Decided it's not a big deal and just skipping tests for my the App component to keep making progress.
I encountered the same error that we saw on the sandbox again. This time when running a Jest test that shallow renders my main
<App />
component using Enzyme:It seems to be triggered by using
import { useRouter } from 'react-router-ts';
, since this line is pointed out in the error message. That's also about when we saw the error on the sandbox too, after it was updated to use that.Possibly an issue with the build script not compiling the
./basename
file?Interestingly, my app runs fine. Only my tests causes the error.
The text was updated successfully, but these errors were encountered: