Closed richmondp closed 1 day ago
This issue has been automatically marked as stale because it hasn't had any activity for 6 months. Many things may have changed within this time. The issue may have already been fixed or it may not be relevant anymore. If at this point, this is still an issue, please respond with updated information. It will be closed in 21 days if no further activity occurs. Thanks for being a part of the Nx community! 🙏
Current Behavior
I have configured a very simple monorepo with an express app and 2 JS libraries (using the 3 commands below).
The first library has a function that takes a string and converts it to lowercase using javascript's
toLowerCase()
function.The second library also converts to lowercase but the library function imports the
lowerCase
function from lodash.A basic test is setup in the express app for both library functions,
without-import.test.ts
(native JS function) andwith-import.test.ts
(lodash).The
without-import.test.ts
runs without any problems, but thewith-import.test.ts
fails with the error `SyntaxError: Unexpected token 'export'Commands to re-create the repo
npx create-nx-workspace --preset=express
npx nx g @nx/js:lib libs/lowercase
npx nx g @nx/js:lib libs/lowercase-import
Expected Behavior
I would expect that I could run tests that call a library that with it's own imports.
When running
nx run sample-api:test
, all tests should passGitHub Repo
https://github.com/richmondp/nx-express-app-test-failures
Steps to Reproduce
nx run sample-api:test
. 1 test will pass, 1 test will fail.Nx Report
Failure Logs
No response
Package Manager Version
No response
Operating System
Additional Information
No response