https://cypress.io logo
Unknown file extension ".ts" even when node_module...
# i-need-help
r
Using cypress/included:12.1.0 image. I have a volume mount for node_modules that contains typescript and yet I still get this error
Copy code
Your configFile is invalid: /cypress.config.ts
It threw an error when required, check the stack trace below:
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /cypress.config.ts
I tried the symlink mentioned in the last comment, and this was fine when I was just doing e2e testing. With component testing, I have a volume mount for my root node_modules into my cypress container. And the symlink along with the volume mount is not working out
For future reference... I updated NODE_PATH in environment and "cd ~/.. && yarn" in my --entrypoint in docker-compose. Basically, I needed my root package.json to be used, and this is how I accomplished that. This is all a little jumbled, but I hope this helps if you are encountering the same issue
l
Been seeing this in a CRA application, none of the solutions work since most of them are focused on docker
Okay, renaming the cypress.config.ts to cypress.config.mjs solved the issue.
2 Views