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

ts-loader compatibility with typescript 5.6.3 ? #1659

Open
vitto-moz opened this issue Oct 22, 2024 · 0 comments
Open

ts-loader compatibility with typescript 5.6.3 ? #1659

vitto-moz opened this issue Oct 22, 2024 · 0 comments

Comments

@vitto-moz
Copy link

vitto-moz commented Oct 22, 2024

Expected Behaviour

I use emotion.d.ts file to redeclare the Theme interface, and everything works fine with typescript 5.5.4, but after updated to typescript 5.6.3 the build fails with errors pointing on ts-loader.

Actual Behaviour

After the Typescript version update to 5.6.3 looks like emotion.d.ts is skipped by compiler, and there are errors that point on the default Theme interface which is just empty object.

[tsl] ERROR in C:\some-path\components\Page.tsx(63,38)
      TS2339: Property 'colors' does not exist on type 'Theme'.
ts-loader-default_321045a7e6183ef3
Error: [tsl] ERROR in C:\some-path\Page.tsx(63,38)
      TS2339: Property 'colors' does not exist on type 'Theme'.
    at makeError (C:\some-path\node_modules\ts-loader\dist\utils.js:93:19)
    at C:\some-path\node_modules\ts-loader\dist\utils.js:63:27
    at Array.map (<anonymous>)
    at formatErrors (C:\some-path\node_modules\ts-loader\dist\utils.js:46:14)
    at provideErrorsToWebpack (C:\some-path\node_modules\ts-loader\dist\after-compile.js:167:62)
    at C:\some-path\node_modules\ts-loader\dist\after-compile.js:36:9
    at C:\some-path\node_modules\ts-loader\dist\instances.js:206:13
    at fn (C:\some-path\node_modules\webpack\lib\Compilation.js:491:10)
    at Hook.eval [as callAsync] (eval at create (C:\some-path\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:20:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (C:\some-path\node_modules\tapable\lib\Hook.js:18:14)

Steps to Reproduce the Problem

  1. Setup project
"dependencies": {
    "@emotion/react": "11.13.3",
    "@emotion/styled": "11.13.0",
    "ts-loader": "9.5.1",
    "typescript": "5.6.3",
    ... 
  1. Re-Declare Theme interface
// emotion.d.ts
import '@emotion/react'

declare module '@emotion/react' {
  export interface Theme {
    colors: {
      black: string
      darkBlue: string
      darkGreen: string
      gray: string
      green: string
      lightGreen: string
      mediumGreen: string
      orange: string
      cyan: string
      magenta: string
      purple: string
      red: string
      yellow: string
      white: string
    }
  1. yarn run start
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

1 participant