Skip to content

Commit

Permalink
Added workaround for --isolatedModules inside of configuration files (#…
Browse files Browse the repository at this point in the history
…39004)

This relates to a bug from issue #38957 found inside of the `with-cypress` example as a result of the recent typescript conversion. This issue can be resolved with adding `export {};` which prevents TypeScript from reading `.ts` configuration files from being read as legacy script files. This issue has been resolved on StackOverflow [here](https://stackoverflow.com/questions/56577201/why-is-isolatedmodules-error-fixed-by-any-import). More info on `--isolatedModules` can be read [here](https://www.typescriptlang.org/tsconfig#isolatedModules).

## Bug

- [x] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [x] Errors have helpful link attached, see `contributing.md`


Fixes #38597
  • Loading branch information
titusdmoore committed Jul 26, 2022
1 parent e2286ee commit 5bd155e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/with-cypress/cypress.config.ts
Expand Up @@ -5,3 +5,6 @@ module.exports = defineConfig({
baseUrl: 'http://localhost:3000',
},
})

// Prevent TypeScript from reading file as legacy script
export {}
3 changes: 3 additions & 0 deletions examples/with-cypress/cypress/e2e/app.cy.ts
Expand Up @@ -18,3 +18,6 @@ describe('Navigation', () => {
cy.get('h1').contains('About Page')
})
})

// Prevent TypeScript from reading file as legacy script
export {}
3 changes: 3 additions & 0 deletions examples/with-cypress/cypress/support/commands.ts
Expand Up @@ -35,3 +35,6 @@
// }
// }
// }

// Prevent TypeScript from reading file as legacy script
export {}

0 comments on commit 5bd155e

Please sign in to comment.