-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"react-scripts test" fails for valid JS files from modules which are successfully built #5164
Comments
Can you provide a small repo demonstrating this bug? |
Did this work before with 1.x? |
Added test repos as example (updated description):
The project starts, builds, renders "43". Basically, import works just fine with Jest for project files, but it fails when inside a module, which has to be built too by the new v2 approach, as I think. Inconsistency between scripts. |
I can repo with the setup above but this also fails with react-scripts: 1.1.5
|
I’m not telling it is a regression. It is inconsistency. |
We'll need to think about this. Compiling newer features does work for tests AFAIK — but just not for I'm worried that compiling Another way to look at it is: if you ship Now, I know your use case is a bit different: submodule etc. It's not really third-party code you plan to publish. But then the problem you have is more about #5161, which is a missing feature. Even if we solved this from |
Yeah, considering this was the prior behavior in v1, I'd said it'd be appropriate to merge this with #5161. |
Is this a bug report?
Yes
Environment
Steps to Reproduce
import something from 'something'
react-scripts build
(all good)react-scripts test --verbose
(test with this import fails)Expected Behavior
Build passes.
Test passes.
Actual Behavior
Build passes.
Test fails because of
SyntaxError: Unexpected identifier
, pointing toimport
.Linking with #5103.
The text was updated successfully, but these errors were encountered: