question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Module doesn't exist on jest config file for express application

See original GitHub issue

Current 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

  1. npx create-nx-workspace@latest

Workspace name (e.g., org name): myorg What to create in the new workspace: empty

  1. yarn add -D @nrwl/express
  2. nx generate @nrwl/express:application api

image

Environment

Windows 10, Node 12.18.3

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
bekoscommented, Sep 3, 2020

@zefexdeveloper seems like the eslintrc inside the api folder should use "ignorePatterns": ["/*.*", "!src/**/*"], so it will only lint whatever is inside your src folder. I will try to prepare a PR, but try it and tell me if that works for you 😃

1reaction
JamesHenrycommented, Oct 13, 2020

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found