-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Typescript support: support / load user defined tsconfig.json for transpiling files #7006
Typescript support: support / load user defined tsconfig.json for transpiling files #7006
Comments
I just tried to upgrade to 4.4.0 and ended up with the same error. Everything was working just fine with that version but if I try to take advantage of the new feature:
To have it working previously I had to do the following: const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
module.exports = {
resolve: {
extensions: ['.ts', '.js'],
plugins: [
new TsconfigPathsPlugin({
configFile: './tsconfig.json',
}),
],
},
module: {
rules: [
{
test: /\.ts$/,
exclude: [/node_modules/],
use: [
{
loader: 'ts-loader',
options: {
configFile: 'tsconfig.e2e.json',
},
},
],
},
],
},
}; |
I am having trouble with 4.4.0 and TypeScript files also. When I run a build with my own When I run Cypress against all of my I say "cryptic" messages because A. the TS files compile just fine on their own, and B. the error message points to a line:column number that makes no sense (issue with not having sourcemaps maybe?)
When I look at export function myFunction(s: string) {
// ^ this is char 12 where Cypress says there is an error
// clearly something is not correct about line:col in error message At best, this would work flawlessly (maybe needs to parse my tsconfig.json?) |
Reproducible test case in https://github.com/cypress-io/cypress-test-tiny/tree/test-path-ts |
@jennifer-shehane any update on the status for this one? |
I'm on Cypress 4.7.0 and running into something that looks remarkably similar to this. I'm seeing cryptic syntax errors on line:columns that make no sense (in my case, they are empty lines). |
Hoping this gets picked up soon. We are trying to move to typescript and eliminate relative path hell |
I'm hitting the same error on my build server (running cypress/included:4.8.0 docker image) with a better error message:
This is only occurring in *.spec.ts files that have a custom function defined with typed parameters. I am also including my own tsconfig.json that sits at the same root directory as cypress.json and package.json. tsconfig.json:
No errors occur when running locally with |
Good, I am not alone. I can reproduce this issue only in my Docker image, using
The issue is the incorrect tsconfig.json being loaded, that's quite weird |
The code for this is done in cypress-io/cypress#7982, but has yet to be released. |
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Current behavior:
index.spec.ts
Fails with
Desired behavior:
ts-node
should load an user definedtsconfig.json
to find own path mappings.Test code to reproduce
tsconfig.json
with a path mapping to a libVersions
4.4.0
The text was updated successfully, but these errors were encountered: