Module doesn't exist on jest config file for express application
See original GitHub issueCurrent Behavior
I created an empty workspace and everything is working just fine but when I added an express application following the documentation on Express Plugin the jest.config.js
file is giving me an error saying that module
doesn’t exist.
Expected Behavior
It shouldn’t give me an error on the jest config file.
Steps to Reproduce
npx create-nx-workspace@latest
Workspace name (e.g., org name): myorg What to create in the new workspace: empty
yarn add -D @nrwl/express
nx generate @nrwl/express:application api
Environment
Windows 10, Node 12.18.3
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (2 by maintainers)
Top Results From Across the Web
Jest gives `Cannot find module` when importing components ...
My tests that run files that only contain relative paths in the tree run correctly. To Clarify, I'm looking for how to configure...
Read more >Configuring Jest
If the file specified by path is not found, an error is returned. For example, with the following configuration: JavaScript; TypeScript.
Read more >Documentation - Module Resolution - TypeScript
Note that relative module imports are not impacted by setting the baseUrl, as they are always resolved relative to their importing files. You...
Read more >Configuration | NestJS - A progressive Node.js framework
In Node.js applications, it's common to use .env files, holding key-value pairs ... In that case, you will not need to import ConfigModule...
Read more >eslint-plugin-jest - npm
This means it's generally not suitable to include them in your top-level configuration as that applies to all files being linted which can ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@zefexdeveloper seems like the
eslintrc
inside theapi
folder should use"ignorePatterns": ["/*.*", "!src/**/*"]
, so it will only lint whatever is inside yoursrc
folder. I will try to prepare a PR, but try it and tell me if that works for you 😃Ok fair enough, there is more of a config issue than a builder issue. We have some updates in the works which will more holistically address this automatically which should hopefully land in
v10.4.0