Skip to content
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

Can't walk dependency graph: cannot find module #240

Open
olafgorter opened this issue Jan 25, 2024 · 2 comments
Open

Can't walk dependency graph: cannot find module #240

olafgorter opened this issue Jan 25, 2024 · 2 comments

Comments

@olafgorter
Copy link

olafgorter commented Jan 25, 2024

I want to make use of the cypress markdown preprocessor.
After installing it with npm:
npm i -D cypress-markdown-preprocessor

and configured the plugin:
/ cypress.config.js
const { defineConfig } = require('cypress')
const mdPreprocessor = require('cypress-markdown-preprocessor')

module.exports = defineConfig({
e2e: {
setupNodeEvents(on, config) {
on('file:preprocessor', mdPreprocessor)
return config
},
// use Markdown file from folder "docs" as tests
specPattern: 'docs/**/*.md',
},
})

I created a first test file, which I ran in Cypress. I got an error:
Can't walk dependency graph: Cannot find module in
node_modules@bahmutovcypress-fiddlesrcindex.js'

That is strange because I have this folder in my node_modules:
node_modules@bahmutov\cypress-fiddle\src\index.js

So, because there was only one place where I had to fill in a require, at the mdPreprocessor cypress config, I don't know what to do.

Olaf

@rk508501
Copy link

@olafgorter From what I have seen it happens in Windows machines, had no issues while doing the same on a Mac.

@olafgorter
Copy link
Author

olafgorter commented Jan 29, 2024

I tested it again on a empty project. Just a index.html with an h1 tag. Installed Cypress, installed Cypress Markdown Pre Processor. Configured the plugin:

// cypress.config.js
const { defineConfig } = require('cypress')
const mdPreprocessor = require('cypress-markdown-preprocessor')

module.exports = defineConfig({
e2e: {
setupNodeEvents(on, config) {
on('file:preprocessor', mdPreprocessor)
return config
},
// use Markdown file from folder "docs" as tests
specPattern: 'docs/**/*.md',
},
})

wrote test.md file in docs folder. open cypress. choose selected test.md files. error:
Can't walk dependency graph: Cannot find module

Do I do something wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants