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

File collections.json cannot be found when it is in the CWD #484

Open
bcsikos-agi opened this issue Sep 4, 2023 · 1 comment
Open

File collections.json cannot be found when it is in the CWD #484

bcsikos-agi opened this issue Sep 4, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@bcsikos-agi
Copy link

Describe the bug
When I have my package.json in the same folder as mocks.config.js and collections.js, even if I configure the collections.json filepath properly in the mocks.config.js, it cannot be found.

To Reproduce
Have a package.json in the same folder as mocks.config.js and collections.js. Configure the collections.json filepath in the mocks.config.js as file.path: '.'

Expected behavior
Expected to work the same way as in a parent folder.

Logs
I don't have the setup at the moment.

** Operating system, Node.js an npm versions, or browser version (please complete the following information):**

  • OS: Mac
  • Node.js: 18
  • npm: 8
  • Browser: N/A

Additional context
N/A

@javierbrea
Copy link
Member

Hi @bcsikos-agi , I'm sorry but, for the moment the folder containing routes and collections can't be the project folder itself. Note that the server watches for changes in the files, and it cleans the require cache each time a file is modified, so, it may produce to clean the cache of the of the server itself, because the project root usually contains the node_modules folder containing it.

Maybe this could be achieved by allowing to provide a separated configuration for the collections file, or by providing an option for ignoring certain subpaths.

@javierbrea javierbrea added the enhancement New feature or request label Oct 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: To do
Development

No branches or pull requests

2 participants